Merge branch 'master' into tscJsFilesxt

This commit is contained in:
Sheetal Nandi
2015-09-21 15:50:39 -07:00
49 changed files with 1393 additions and 508 deletions

View File

@@ -1,16 +1,16 @@
tests/cases/conformance/ambient/ambientErrors.ts(2,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(6,18): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/conformance/ambient/ambientErrors.ts(17,22): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(20,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(24,5): error TS1066: Ambient enum elements can only have integer literal initializers.
tests/cases/conformance/ambient/ambientErrors.ts(29,5): error TS1066: Ambient enum elements can only have integer literal initializers.
tests/cases/conformance/ambient/ambientErrors.ts(34,11): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/ambient/ambientErrors.ts(47,20): error TS2435: Ambient modules cannot be nested in other modules.
tests/cases/conformance/ambient/ambientErrors.ts(51,16): error TS2436: Ambient module declaration cannot specify relative module name.
tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
@@ -44,7 +44,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
// Ambient function with function body
declare function fn4() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
// Ambient enum with non - integer literal constant member
declare enum E1 {
@@ -67,7 +67,7 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
!!! error TS1039: Initializers are not allowed in ambient contexts.
function fn() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
class C {
static x = 3;
~
@@ -77,13 +77,13 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export
!!! error TS1039: Initializers are not allowed in ambient contexts.
constructor() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
fn() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static sfn() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
}

View File

@@ -1,5 +1,5 @@
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,5): error TS1242: 'abstract' modifier can only appear on a class or method declaration.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,28): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(2,28): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(11,15): error TS2515: Non-abstract class 'CC' does not implement inherited abstract member 'foo' from class 'AA'.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(13,15): error TS2515: Non-abstract class 'DD' does not implement inherited abstract member 'foo' from class 'BB'.
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractDeclarations.d.ts(17,15): error TS2515: Non-abstract class 'FF' does not implement inherited abstract member 'foo' from class 'CC'.
@@ -11,7 +11,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
~~~~~~~~
!!! error TS1242: 'abstract' modifier can only appear on a class or method declaration.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
declare abstract class AA {

View File

@@ -1,4 +1,4 @@
tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/constructorOverloads6.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/compiler/constructorOverloads6.ts(4,25): error TS1184: An implementa
constructor(n: number);
constructor(x: any) {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
bar1():void;

View File

@@ -0,0 +1,67 @@
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(17,24): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(20,24): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(28,27): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(31,27): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(39,36): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts(42,36): error TS7006: Parameter 'arg' implicitly has an 'any' type.
==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration01.ts (6 errors) ====
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
static method1(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
static method2(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
static method1 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
static method2 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
static method1 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
static method2 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}

View File

@@ -0,0 +1,88 @@
//// [contextuallyTypedClassExpressionMethodDeclaration01.ts]
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
static method1(arg) {
arg.numProp = 10;
}
static method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
static method1 = (arg) => {
arg.numProp = 10;
}
static method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
static method1 = function (arg) {
arg.numProp = 10;
}
static method2 = function (arg) {
arg.strProp = "hello";
}
}
}
//// [contextuallyTypedClassExpressionMethodDeclaration01.js]
function getFoo1() {
return (function () {
function class_1() {
}
class_1.method1 = function (arg) {
arg.numProp = 10;
};
class_1.method2 = function (arg) {
arg.strProp = "hello";
};
return class_1;
})();
}
function getFoo2() {
return (function () {
function class_2() {
}
class_2.method1 = function (arg) {
arg.numProp = 10;
};
class_2.method2 = function (arg) {
arg.strProp = "hello";
};
return class_2;
})();
}
function getFoo3() {
return (function () {
function class_3() {
}
class_3.method1 = function (arg) {
arg.numProp = 10;
};
class_3.method2 = function (arg) {
arg.strProp = "hello";
};
return class_3;
})();
}

View File

@@ -0,0 +1,71 @@
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(21,17): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(24,17): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(32,20): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(35,20): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(43,29): error TS7006: Parameter 'arg' implicitly has an 'any' type.
tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts(46,29): error TS7006: Parameter 'arg' implicitly has an 'any' type.
==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedClassExpressionMethodDeclaration02.ts (6 errors) ====
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
new (): Bar;
}
interface Bar {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
method1(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
method2(arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
method1 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
method2 = (arg) => {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
method1 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.numProp = 10;
}
method2 = function (arg) {
~~~
!!! error TS7006: Parameter 'arg' implicitly has an 'any' type.
arg.strProp = "hello";
}
}
}

View File

@@ -0,0 +1,92 @@
//// [contextuallyTypedClassExpressionMethodDeclaration02.ts]
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
new (): Bar;
}
interface Bar {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
method1(arg) {
arg.numProp = 10;
}
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
method1 = (arg) => {
arg.numProp = 10;
}
method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
method1 = function (arg) {
arg.numProp = 10;
}
method2 = function (arg) {
arg.strProp = "hello";
}
}
}
//// [contextuallyTypedClassExpressionMethodDeclaration02.js]
function getFoo1() {
return (function () {
function class_1() {
}
class_1.prototype.method1 = function (arg) {
arg.numProp = 10;
};
class_1.prototype.method2 = function (arg) {
arg.strProp = "hello";
};
return class_1;
})();
}
function getFoo2() {
return (function () {
function class_2() {
this.method1 = function (arg) {
arg.numProp = 10;
};
this.method2 = function (arg) {
arg.strProp = "hello";
};
}
return class_2;
})();
}
function getFoo3() {
return (function () {
function class_3() {
this.method1 = function (arg) {
arg.numProp = 10;
};
this.method2 = function (arg) {
arg.strProp = "hello";
};
}
return class_3;
})();
}

View File

@@ -0,0 +1,79 @@
//// [contextuallyTypedObjectLiteralMethodDeclaration01.ts]
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return {
method1(arg) {
arg.numProp = 10;
},
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return {
method1: (arg) => {
arg.numProp = 10;
},
method2: (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
}
}
//// [contextuallyTypedObjectLiteralMethodDeclaration01.js]
function getFoo1() {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
};
}
function getFoo2() {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
};
}
function getFoo3() {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
};
}

View File

@@ -0,0 +1,110 @@
=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.ts ===
interface A {
>A : Symbol(A, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 0, 0))
numProp: number;
>numProp : Symbol(numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
}
interface B {
>B : Symbol(B, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 3, 1))
strProp: string;
>strProp : Symbol(strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
interface Foo {
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
method1(arg: A): void;
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 9, 15))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 10, 12))
>A : Symbol(A, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 0, 0))
method2(arg: B): void;
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 10, 26))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 11, 12))
>B : Symbol(B, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 3, 1))
}
function getFoo1(): Foo {
>getFoo1 : Symbol(getFoo1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 12, 1))
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
return {
method1(arg) {
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 15, 12))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 16, 16))
arg.numProp = 10;
>arg.numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 16, 16))
>numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
},
method2(arg) {
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 18, 10))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 19, 16))
arg.strProp = "hello";
>arg.strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 19, 16))
>strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
}
}
function getFoo2(): Foo {
>getFoo2 : Symbol(getFoo2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 23, 1))
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
return {
method1: (arg) => {
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 26, 12))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 27, 18))
arg.numProp = 10;
>arg.numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 27, 18))
>numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
},
method2: (arg) => {
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 29, 10))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 30, 18))
arg.strProp = "hello";
>arg.strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 30, 18))
>strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
}
}
function getFoo3(): Foo {
>getFoo3 : Symbol(getFoo3, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 34, 1))
>Foo : Symbol(Foo, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 7, 1))
return {
method1: function (arg) {
>method1 : Symbol(method1, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 37, 12))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 38, 27))
arg.numProp = 10;
>arg.numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 38, 27))
>numProp : Symbol(A.numProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 1, 13))
},
method2: function (arg) {
>method2 : Symbol(method2, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 40, 10))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 41, 27))
arg.strProp = "hello";
>arg.strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
>arg : Symbol(arg, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 41, 27))
>strProp : Symbol(B.strProp, Decl(contextuallyTypedObjectLiteralMethodDeclaration01.ts, 5, 14))
}
}
}

View File

@@ -0,0 +1,132 @@
=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.ts ===
interface A {
>A : A
numProp: number;
>numProp : number
}
interface B {
>B : B
strProp: string;
>strProp : string
}
interface Foo {
>Foo : Foo
method1(arg: A): void;
>method1 : (arg: A) => void
>arg : A
>A : A
method2(arg: B): void;
>method2 : (arg: B) => void
>arg : B
>B : B
}
function getFoo1(): Foo {
>getFoo1 : () => Foo
>Foo : Foo
return {
>{ method1(arg) { arg.numProp = 10; }, method2(arg) { arg.strProp = "hello"; } } : { method1(arg: A): void; method2(arg: B): void; }
method1(arg) {
>method1 : (arg: A) => void
>arg : A
arg.numProp = 10;
>arg.numProp = 10 : number
>arg.numProp : number
>arg : A
>numProp : number
>10 : number
},
method2(arg) {
>method2 : (arg: B) => void
>arg : B
arg.strProp = "hello";
>arg.strProp = "hello" : string
>arg.strProp : string
>arg : B
>strProp : string
>"hello" : string
}
}
}
function getFoo2(): Foo {
>getFoo2 : () => Foo
>Foo : Foo
return {
>{ method1: (arg) => { arg.numProp = 10; }, method2: (arg) => { arg.strProp = "hello"; } } : { method1: (arg: A) => void; method2: (arg: B) => void; }
method1: (arg) => {
>method1 : (arg: A) => void
>(arg) => { arg.numProp = 10; } : (arg: A) => void
>arg : A
arg.numProp = 10;
>arg.numProp = 10 : number
>arg.numProp : number
>arg : A
>numProp : number
>10 : number
},
method2: (arg) => {
>method2 : (arg: B) => void
>(arg) => { arg.strProp = "hello"; } : (arg: B) => void
>arg : B
arg.strProp = "hello";
>arg.strProp = "hello" : string
>arg.strProp : string
>arg : B
>strProp : string
>"hello" : string
}
}
}
function getFoo3(): Foo {
>getFoo3 : () => Foo
>Foo : Foo
return {
>{ method1: function (arg) { arg.numProp = 10; }, method2: function (arg) { arg.strProp = "hello"; } } : { method1: (arg: A) => void; method2: (arg: B) => void; }
method1: function (arg) {
>method1 : (arg: A) => void
>function (arg) { arg.numProp = 10; } : (arg: A) => void
>arg : A
arg.numProp = 10;
>arg.numProp = 10 : number
>arg.numProp : number
>arg : A
>numProp : number
>10 : number
},
method2: function (arg) {
>method2 : (arg: B) => void
>function (arg) { arg.strProp = "hello"; } : (arg: B) => void
>arg : B
arg.strProp = "hello";
>arg.strProp = "hello" : string
>arg.strProp : string
>arg : B
>strProp : string
>"hello" : string
}
}
}

View File

@@ -1,15 +1,15 @@
tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/exportDeclareClass1.ts (2 errors) ====
export declare class eaC {
static tF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
};
export declare class eaC2 {

View File

@@ -1,4 +1,4 @@
tests/cases/compiler/externSyntax.ts(8,20): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/externSyntax.ts(8,20): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/externSyntax.ts (1 errors) ====
@@ -11,7 +11,7 @@ tests/cases/compiler/externSyntax.ts(8,20): error TS1184: An implementation cann
public f();
public g() { } // error body
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
}

View File

@@ -1,11 +1,11 @@
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,4): error TS1184: Modifiers cannot appear here.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,21): error TS2393: Duplicate function implementation.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(2,25): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,4): error TS1184: Modifiers cannot appear here.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(3,20): error TS2393: Duplicate function implementation.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,4): error TS1184: Modifiers cannot appear here.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,28): error TS2393: Duplicate function implementation.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/functionsWithModifiersInBlocks1.ts (8 errors) ====
@@ -16,7 +16,7 @@ tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An
~
!!! error TS2393: Duplicate function implementation.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export function f() { }
~~~~~~
!!! error TS1184: Modifiers cannot appear here.
@@ -28,5 +28,5 @@ tests/cases/compiler/functionsWithModifiersInBlocks1.ts(4,32): error TS1184: An
~
!!! error TS2393: Duplicate function implementation.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}

View File

@@ -44,7 +44,7 @@ tests/cases/compiler/giant.ts(125,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(154,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(154,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(167,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'.
@@ -68,39 +68,39 @@ tests/cases/compiler/giant.ts(204,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(233,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(238,35): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(240,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(243,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(244,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(233,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(238,35): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(240,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(243,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(244,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(245,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(245,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(246,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(247,16): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(247,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(247,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(248,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(248,20): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(249,17): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(249,23): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(249,23): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(250,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(250,21): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(251,17): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(251,32): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(251,32): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(252,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(252,21): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(254,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(254,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(255,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(255,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(255,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(256,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(256,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(257,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(257,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(258,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(262,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(262,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(267,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(267,30): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(282,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'.
@@ -147,7 +147,7 @@ tests/cases/compiler/giant.ts(383,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(412,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(412,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(425,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'.
@@ -171,98 +171,98 @@ tests/cases/compiler/giant.ts(462,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(491,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(496,35): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(498,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(501,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(502,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(491,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(496,35): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(498,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(501,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(502,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(503,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(503,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(504,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(505,16): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(505,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(505,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(506,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(506,20): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(507,17): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(507,23): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(507,23): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(508,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(508,21): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(509,17): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(509,32): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(509,32): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(510,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(510,21): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(512,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(512,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(513,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(513,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(513,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(514,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(514,20): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(515,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(515,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(515,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(516,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(516,20): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(520,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(520,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(520,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(525,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(532,31): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(534,20): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(537,17): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(538,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(525,30): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(532,31): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(534,20): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(537,17): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(538,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(539,12): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(539,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(539,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(540,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(540,16): error TS2300: Duplicate identifier 'pgF'.
tests/cases/compiler/giant.ts(541,12): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(541,27): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(541,27): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(542,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(542,16): error TS2300: Duplicate identifier 'psF'.
tests/cases/compiler/giant.ts(543,13): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(543,19): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(543,19): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(544,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(544,17): error TS2300: Duplicate identifier 'rgF'.
tests/cases/compiler/giant.ts(545,13): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(545,28): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(545,28): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(546,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(546,17): error TS2300: Duplicate identifier 'rsF'.
tests/cases/compiler/giant.ts(548,17): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(548,17): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(549,12): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(549,27): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(549,27): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(550,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(550,16): error TS2300: Duplicate identifier 'tsF'.
tests/cases/compiler/giant.ts(551,12): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(551,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(551,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(552,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(552,16): error TS2300: Duplicate identifier 'tgF'.
tests/cases/compiler/giant.ts(556,18): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(556,18): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(558,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(561,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(563,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(558,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(561,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(563,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(587,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(587,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(606,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(606,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(606,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(611,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(611,30): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(616,39): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(616,39): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/giant.ts(621,26): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(623,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(626,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(628,21): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(621,26): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(623,24): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(626,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(628,21): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(653,9): error TS1169: A computed property name in an interface must directly refer to a built-in symbol.
tests/cases/compiler/giant.ts(653,10): error TS2304: Cannot find name 'p'.
tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all be optional or required.
tests/cases/compiler/giant.ts(672,22): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(672,22): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(672,25): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/giant.ts(676,30): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/giant.ts (265 errors) ====
@@ -513,7 +513,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
@@ -640,31 +640,31 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private rF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pgF() { }
~~~
!!! error TS2300: Duplicate identifier 'pgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public get pgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -674,7 +674,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'psF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public set psF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -684,7 +684,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private get rgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -694,7 +694,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private set rsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -703,12 +703,12 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { }
~~~
!!! error TS2300: Duplicate identifier 'tsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static set tsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -718,7 +718,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'tgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static get tgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -729,7 +729,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -738,7 +738,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -977,7 +977,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
@@ -1104,31 +1104,31 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { };
export declare module eaM { };
}
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private rF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pgF() { }
~~~
!!! error TS2300: Duplicate identifier 'pgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public get pgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1138,7 +1138,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'psF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public set psF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1148,7 +1148,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private get rgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1158,7 +1158,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private set rsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1167,12 +1167,12 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { }
~~~
!!! error TS2300: Duplicate identifier 'tsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static set tsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1182,7 +1182,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'tgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static get tgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1193,7 +1193,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -1202,7 +1202,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -1211,24 +1211,24 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export declare var eaV;
export declare function eaF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private rF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pgF() { }
~~~
!!! error TS2300: Duplicate identifier 'pgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public get pgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1238,7 +1238,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'psF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public set psF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1248,7 +1248,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private get rgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1258,7 +1258,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'rsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
private set rsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1267,12 +1267,12 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tsF(param:any) { }
~~~
!!! error TS2300: Duplicate identifier 'tsF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static set tsF(param:any)
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1282,7 +1282,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~
!!! error TS2300: Duplicate identifier 'tgF'.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static get tgF()
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1293,22 +1293,22 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tV;
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
interface I {
//Call Signature
@@ -1363,7 +1363,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -1372,7 +1372,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }
@@ -1383,7 +1383,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
~~~~~~~
!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export declare class eaC { }
~~~~~~~
!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context.
@@ -1394,20 +1394,20 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC {
constructor () { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
public pV;
private rV;
public pF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
static tV
static tF() { }
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
export interface eI {
//Call Signature
@@ -1463,7 +1463,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
var V;
function F() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
~
!!! error TS1036: Statements are not allowed in ambient contexts.
class C { }
@@ -1471,7 +1471,7 @@ tests/cases/compiler/giant.ts(676,30): error TS1184: An implementation cannot be
export var eV;
export function eF() { };
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
export class eC { }
export interface eI { }
export module eM { }

View File

@@ -1,6 +1,6 @@
tests/cases/conformance/externalModules/file1.d.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(7,16): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(7,16): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(16,2): error TS1036: Statements are not allowed in ambient contexts.
@@ -20,7 +20,7 @@ tests/cases/conformance/externalModules/file1.d.ts(18,16): error TS1039: Initial
!!! error TS1039: Initializers are not allowed in ambient contexts.
fn(): boolean {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
return false;
}
}

View File

@@ -1,7 +1,7 @@
error TS5054: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
error TS5055: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5054: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5055: Could not write file 'tests/cases/compiler/b.js' which is one of the input files.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@@ -1,5 +1,5 @@
tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/compiler/methodInAmbientClass1.ts (2 errors) ====
@@ -8,6 +8,6 @@ tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1184: An implementa
~~~~~~~
!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
}

View File

@@ -1,4 +1,4 @@
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration18.ts(4,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration18.ts(4,25): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration18.ts (1 errors) ====
@@ -7,7 +7,7 @@ tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclarat
constructor(n: number);
constructor(x: any) {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}
bar1():void;
}

View File

@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts(2,3): error TS1031: 'declare' modifier cannot appear on a class element.
tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts(2,25): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts(2,25): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration4.ts (2 errors) ====
@@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstru
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on a class element.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}

View File

@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,14): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,14): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts (2 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDe
~~~~~~~~
!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}

View File

@@ -1,8 +1,8 @@
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.ts(1,24): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.ts(1,24): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.ts (1 errors) ====
declare function Foo() {
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}

View File

@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts(2,5): error TS1031: 'declare' modifier cannot appear on a class element.
tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts(2,19): error TS1184: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts(2,19): error TS1183: An implementation cannot be declared in ambient contexts.
==== tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemberFunctionDeclaration5.ts (2 errors) ====
@@ -8,5 +8,5 @@ tests/cases/conformance/parser/ecmascript5/MemberFunctionDeclarations/parserMemb
~~~~~~~
!!! error TS1031: 'declare' modifier cannot appear on a class element.
~
!!! error TS1184: An implementation cannot be declared in ambient contexts.
!!! error TS1183: An implementation cannot be declared in ambient contexts.
}

View File

@@ -0,0 +1,47 @@
// @noImplicitAny: true
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
static method1(arg) {
arg.numProp = 10;
}
static method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
static method1 = (arg) => {
arg.numProp = 10;
}
static method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
static method1 = function (arg) {
arg.numProp = 10;
}
static method2 = function (arg) {
arg.strProp = "hello";
}
}
}

View File

@@ -0,0 +1,51 @@
// @noImplicitAny: true
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
new (): Bar;
}
interface Bar {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return class {
method1(arg) {
arg.numProp = 10;
}
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return class {
method1 = (arg) => {
arg.numProp = 10;
}
method2 = (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return class {
method1 = function (arg) {
arg.numProp = 10;
}
method2 = function (arg) {
arg.strProp = "hello";
}
}
}

View File

@@ -0,0 +1,47 @@
// @noImplicitAny: true
interface A {
numProp: number;
}
interface B {
strProp: string;
}
interface Foo {
method1(arg: A): void;
method2(arg: B): void;
}
function getFoo1(): Foo {
return {
method1(arg) {
arg.numProp = 10;
},
method2(arg) {
arg.strProp = "hello";
}
}
}
function getFoo2(): Foo {
return {
method1: (arg) => {
arg.numProp = 10;
},
method2: (arg) => {
arg.strProp = "hello";
}
}
}
function getFoo3(): Foo {
return {
method1: function (arg) {
arg.numProp = 10;
},
method2: function (arg) {
arg.strProp = "hello";
}
}
}

View File

@@ -0,0 +1,32 @@
/// <reference path="fourslash.ts" />
// @noImplicitAny: true
////interface A {
//// numProp: number;
////}
////
////interface B {
//// strProp: string;
////}
////
////interface Foo {
//// method1(arg: A): void;
//// method2(arg: B): void;
////}
////
////function getFoo1(): Foo {
//// return {
//// method1(/*param1*/arg) {
//// arg.numProp = 10;
//// },
//// method2(/*param2*/arg) {
//// arg.strProp = "hello";
//// }
//// }
////}
goTo.marker("param1");
verify.quickInfoIs("(parameter) arg: A")
goTo.marker("param2");
verify.quickInfoIs("(parameter) arg: B")