From 2d9330567c75676c135cafd1b571bc1d48554d4d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 28 Jan 2016 17:38:43 -0800 Subject: [PATCH 1/5] Use names of accessors instead of their entire spans. --- src/compiler/utilities.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 0903d937d7b..5494db5fbd6 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -387,6 +387,8 @@ namespace ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.MethodDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: case SyntaxKind.TypeAliasDeclaration: errorNode = (node).name; break; From e0c9e3bea9204b43377618f4f27775c43bde2616 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 12 Feb 2016 14:44:52 -0800 Subject: [PATCH 2/5] Accepted baselines. --- .../computedPropertyNames36_ES5.errors.txt | 4 ++-- .../computedPropertyNames36_ES6.errors.txt | 4 ++-- .../computedPropertyNames38_ES5.errors.txt | 4 ++-- .../computedPropertyNames38_ES6.errors.txt | 4 ++-- .../computedPropertyNames39_ES5.errors.txt | 4 ++-- .../computedPropertyNames39_ES6.errors.txt | 4 ++-- .../computedPropertyNames43_ES5.errors.txt | 4 ++-- .../computedPropertyNames43_ES6.errors.txt | 4 ++-- .../computedPropertyNames44_ES5.errors.txt | 8 ++++---- .../computedPropertyNames44_ES6.errors.txt | 8 ++++---- .../computedPropertyNames45_ES5.errors.txt | 8 ++++---- .../computedPropertyNames45_ES6.errors.txt | 8 ++++---- .../getAndSetNotIdenticalType.errors.txt | 14 ++++++-------- .../getAndSetNotIdenticalType2.errors.txt | 18 +++++++----------- .../getAndSetNotIdenticalType3.errors.txt | 18 +++++++----------- ...implicitAnyFromCircularInference.errors.txt | 10 ++++------ ...tAndSetAccessorWithAnyReturnType.errors.txt | 17 +++++++---------- .../reference/objectLiteralErrors.errors.txt | 16 ++++++++-------- 18 files changed, 71 insertions(+), 86 deletions(-) diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt index 6c38043c8e0..506a9ca15d1 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES5.ts(8, // Computed properties get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt index 8127898fde4..cf50807ac54 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames36_ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames36_ES6.ts(8, // Computed properties get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames38_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames38_ES5.errors.txt index acc08ee5527..2e5313caa41 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames38_ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,5): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8,9): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES5.ts(8, // Computed properties get [1 << 6]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'. set [1 << 6](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames38_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames38_ES6.errors.txt index 0a95b37f9a9..4c6e78c5b04 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames38_ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts(8,5): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts(8,9): error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames38_ES6.ts(8, // Computed properties get [1 << 6]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '[1 << 6]' of type 'Foo' is not assignable to string index type 'Foo2'. set [1 << 6](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames39_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames39_ES5.errors.txt index 669314676f9..a204ef4ae34 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames39_ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,5): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8,9): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES5.ts(8, // Computed properties get [1 << 6]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'. set [1 << 6](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames39_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames39_ES6.errors.txt index 38f432162d5..d2e2494c87a 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames39_ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts(8,5): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts(8,9): error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts (1 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames39_ES6.ts(8, // Computed properties get [1 << 6]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2412: Property '[1 << 6]' of type 'Foo' is not assignable to numeric index type 'Foo2'. set [1 << 6](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt index 62c239a5a54..d777ae659de 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames43_ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES5.ts(10 class D extends C { // Computed properties get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt index 0efe0ba39ec..6af43ebfa5c 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames43_ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames43_ES6.ts(10 class D extends C { // Computed properties get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. set ["set1"](p: Foo2) { } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt index 35ab422e093..43801ab3d62 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames44_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(6,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts (2 errors) ==== @@ -9,12 +9,12 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES5.ts(10 class C { [s: string]: Foo2; get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } class D extends C { set ["set1"](p: Foo) { } - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt index 5170746395c..28b861347a3 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames44_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(6,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(6,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts (2 errors) ==== @@ -9,12 +9,12 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames44_ES6.ts(10 class C { [s: string]: Foo2; get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } class D extends C { set ["set1"](p: Foo) { } - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt index 8baae68f337..f06d199ba5a 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNames45_ES5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(5,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11 class C { get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } @@ -16,6 +16,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES5.ts(11 // No error when the indexer is in a class more derived than the computed property [s: string]: Foo2; set ["set1"](p: Foo) { } - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt index e329785f4cf..626ed14ad1a 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames45_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(5,5): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. -tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,5): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(5,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11,9): error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11 class C { get ["get1"]() { return new Foo } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } @@ -16,6 +16,6 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNames45_ES6.ts(11 // No error when the indexer is in a class more derived than the computed property [s: string]: Foo2; set ["set1"](p: Foo) { } - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ !!! error TS2411: Property '["set1"]' of type 'Foo' is not assignable to string index type 'Foo2'. } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt index 6c55f966eee..a16cbfe7b37 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt @@ -1,23 +1,21 @@ -tests/cases/compiler/getAndSetNotIdenticalType.ts(2,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getAndSetNotIdenticalType.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType.ts(2,9): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType.ts(5,9): error TS2380: 'get' and 'set' accessor must have the same type. ==== tests/cases/compiler/getAndSetNotIdenticalType.ts (4 errors) ==== class C { get x(): number { - ~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! error TS2380: 'get' and 'set' accessor must have the same type. return 1; - ~~~~~~~~~~~~~~~~~ } - ~~~~~ -!!! error TS2380: 'get' and 'set' accessor must have the same type. set x(v: string) { } - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2380: 'get' and 'set' accessor must have the same type. ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! error TS2380: 'get' and 'set' accessor must have the same type. } \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt index 5cdb9b3a36f..c9fae8cc89c 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'T'. @@ -12,26 +12,22 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A { data: A; get x(): A { - ~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - return this.data; - ~~~~~~~~~~~~~~~~~~~~~~~~~ - } - ~~~~~ + ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. + return this.data; + } set x(v: A) { - ~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! error TS2380: 'get' and 'set' accessor must have the same type. this.data = v; - ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ !!! error TS2322: Type 'A' is not assignable to type 'A'. !!! error TS2322: Type 'string' is not assignable to type 'T'. } - ~~~~~ -!!! error TS2380: 'get' and 'set' accessor must have the same type. } var x = new C(); diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt index 0aac384f7c3..3fb17d65a40 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'number'. @@ -12,26 +12,22 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A { data: A; get x(): A { - ~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - return this.data; - ~~~~~~~~~~~~~~~~~~~~~~~~~ - } - ~~~~~ + ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. + return this.data; + } set x(v: A) { - ~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~ +!!! error TS2380: 'get' and 'set' accessor must have the same type. this.data = v; - ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ !!! error TS2322: Type 'A' is not assignable to type 'A'. !!! error TS2322: Type 'string' is not assignable to type 'number'. } - ~~~~~ -!!! error TS2380: 'get' and 'set' accessor must have the same type. } var x = new C(); diff --git a/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt b/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt index 36538aef4f3..bb43d96b003 100644 --- a/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt +++ b/tests/baselines/reference/implicitAnyFromCircularInference.errors.txt @@ -8,7 +8,7 @@ tests/cases/compiler/implicitAnyFromCircularInference.ts(23,10): error TS7024: F tests/cases/compiler/implicitAnyFromCircularInference.ts(26,10): error TS7023: 'h' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. tests/cases/compiler/implicitAnyFromCircularInference.ts(28,14): error TS7023: 'foo' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. tests/cases/compiler/implicitAnyFromCircularInference.ts(41,5): error TS7022: 's' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. -tests/cases/compiler/implicitAnyFromCircularInference.ts(46,5): error TS7023: 'x' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +tests/cases/compiler/implicitAnyFromCircularInference.ts(46,9): error TS7023: 'x' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. ==== tests/cases/compiler/implicitAnyFromCircularInference.ts (11 errors) ==== @@ -78,11 +78,9 @@ tests/cases/compiler/implicitAnyFromCircularInference.ts(46,5): error TS7023: 'x class D { // Error expected get x() { - ~~~~~~~~~ - return this.x; - ~~~~~~~~~~~~~~~~~~~~~~ - } - ~~~~~ + ~ !!! error TS7023: 'x' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + return this.x; + } } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt index 4d9008cd56a..460ff97b10e 100644 --- a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt +++ b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(3,5): error TS7008: Member 'getAndSet' implicitly has an 'any' type. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(4,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,5): error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,16): error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(15,28): error TS7006: Parameter 'newXValue' implicitly has an 'any' type. -tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,5): error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. ==== tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts (8 errors) ==== @@ -30,24 +30,21 @@ tests/cases/compiler/implicitAnyGetAndSetAccessorWithAnyReturnType.ts(20,16): er class SetterOnly { public set haveOnlySet(newXValue) { // error at "haveOnlySet, newXValue" - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~~~~~~~~~ +!!! error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. ~~~~~~~~~ !!! error TS7006: Parameter 'newXValue' implicitly has an 'any' type. } - ~~~~~ -!!! error TS7016: Property 'haveOnlySet' implicitly has type 'any', because its 'set' accessor lacks a type annotation. } class GetterOnly { public get haveOnlyGet() { // error at "haveOnlyGet" - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - return null; - ~~~~~~~~~~~~~~~~~~~~ - } - ~~~~~ + ~~~~~~~~~~~ !!! error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. + return null; + } } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 19935f52bdc..134b79a443e 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -89,11 +89,11 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,13): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,12): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,43): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,16): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,47): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,12): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,16): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55): error TS2380: 'get' and 'set' accessor must have the same type. ==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (96 errors) ==== @@ -322,16 +322,16 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) // Get and set accessor with mismatched type annotations var g1 = { get a(): number { return 4; }, set a(n: string) { } }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. - ~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. var g2 = { get a() { return 4; }, set a(n: string) { } }; ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. - ~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. \ No newline at end of file From e03a45a824f67f31a7d74c4489156f44417d42f3 Mon Sep 17 00:00:00 2001 From: Bill Ticehurst Date: Fri, 12 Feb 2016 15:40:47 -0800 Subject: [PATCH 3/5] Fix fallback to classic resolution --- src/compiler/program.ts | 2 +- src/harness/harness.ts | 3 ++- ...mportAliasAnExternalModuleInsideAnInternalModule.js | 4 ++-- ...AliasAnExternalModuleInsideAnInternalModule.symbols | 4 ++-- ...rtAliasAnExternalModuleInsideAnInternalModule.types | 2 +- ...mportAliasAnExternalModuleInsideAnInternalModule.ts | 2 +- .../externalModules/relativePathToDeclarationFile.ts | 1 + .../cancellationWhenfindingAllRefsOnDefinition.ts | 2 +- tests/cases/fourslash/cloduleAsBaseClass2.ts | 2 +- tests/cases/fourslash/commentsExternalModules.ts | 6 +++--- tests/cases/fourslash/commentsImportDeclaration.ts | 4 ++-- .../completionListForTransitivelyExportedMembers01.ts | 6 +++--- .../completionListForTransitivelyExportedMembers02.ts | 6 +++--- .../completionListForTransitivelyExportedMembers03.ts | 6 +++--- .../completionListForTransitivelyExportedMembers04.ts | 2 +- .../cases/fourslash/completionListInExportClause01.ts | 10 +++++----- .../cases/fourslash/completionListInImportClause01.ts | 1 + tests/cases/fourslash/definition.ts | 2 +- tests/cases/fourslash/exportEqualCallableInterface.ts | 2 +- tests/cases/fourslash/exportEqualTypes.ts | 4 ++-- tests/cases/fourslash/externalModuleIntellisense.ts | 2 +- .../fourslash/externalModuleWithExportAssignment.ts | 4 ++-- tests/cases/fourslash/findAllRefsOnDefinition.ts | 2 +- tests/cases/fourslash/findAllRefsOnDefinition2.ts | 2 +- tests/cases/fourslash/findAllRefsOnImportAliases.ts | 4 ++-- tests/cases/fourslash/findAllRefsOnImportAliases2.ts | 4 ++-- tests/cases/fourslash/getJavaScriptCompletions15.ts | 6 +++--- tests/cases/fourslash/getPreProcessedFile.ts | 1 + .../fourslash/goToDefinitionExternalModuleName.ts | 2 +- .../fourslash/goToDefinitionExternalModuleName2.ts | 2 +- tests/cases/fourslash/goToDefinitionImportedNames.ts | 2 +- tests/cases/fourslash/goToDefinitionImportedNames2.ts | 2 +- tests/cases/fourslash/goToDefinitionImportedNames3.ts | 8 ++++---- tests/cases/fourslash/goToDefinitionImportedNames4.ts | 2 +- tests/cases/fourslash/goToDefinitionImportedNames5.ts | 2 +- tests/cases/fourslash/goToDefinitionImportedNames6.ts | 2 +- tests/cases/fourslash/goToDefinitionImportedNames7.ts | 2 +- tests/cases/fourslash/goToTypeDefinitionAliases.ts | 4 ++-- tests/cases/fourslash/javaScriptModules13.ts | 2 +- tests/cases/fourslash/javaScriptModules15.ts | 2 +- tests/cases/fourslash/javaScriptModules16.ts | 2 +- tests/cases/fourslash/javaScriptModules19.ts | 2 +- .../fourslash/memberListOfEnumFromExternalModule.ts | 2 +- .../mergedDeclarationsWithExportAssignment1.ts | 4 ++-- .../quickInfoDisplayPartsExternalModuleAlias.ts | 8 ++++---- .../quickInfoExportAssignmentOfGenericInterface.ts | 2 +- tests/cases/fourslash/quickInfoForRequire.ts | 2 +- tests/cases/fourslash/selfReferencedExternalModule.ts | 4 ++-- tests/cases/fourslash/selfReferencedExternalModule2.ts | 4 ++-- tests/cases/fourslash/shims-pp/getPreProcessedFile.ts | 1 + .../fourslash/shims-pp/getReferencesAtPosition.ts | 2 +- tests/cases/fourslash/shims/getPreProcessedFile.ts | 1 + tests/cases/fourslash/shims/getReferencesAtPosition.ts | 2 +- tests/cases/fourslash/verifySingleFileEmitOutput1.ts | 2 +- 54 files changed, 86 insertions(+), 80 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 0acb13f02d3..7a2e65ed33b 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -100,7 +100,7 @@ namespace ts { let moduleResolution = compilerOptions.moduleResolution; if (moduleResolution === undefined) { - moduleResolution = compilerOptions.module === ModuleKind.CommonJS ? ModuleResolutionKind.NodeJs : ModuleResolutionKind.Classic; + moduleResolution = getEmitModuleKind(compilerOptions) === ModuleKind.CommonJS ? ModuleResolutionKind.NodeJs : ModuleResolutionKind.Classic; if (traceEnabled) { trace(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]); } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 2b17195cfb1..4db1a815e9a 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -896,7 +896,8 @@ namespace Harness { { name: "fileName", type: "string" }, { name: "libFiles", type: "string" }, { name: "noErrorTruncation", type: "boolean" }, - { name: "suppressOutputPathCheck", type: "boolean" } + { name: "suppressOutputPathCheck", type: "boolean" }, + { name: "moduleResolution", type: "string"} ]; let optionsIndex: ts.Map; diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js index 81b0d2fdac9..94c084df512 100644 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.js @@ -6,7 +6,7 @@ export module m { } //// [importAliasAnExternalModuleInsideAnInternalModule_file1.ts] -import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +import r = require('./importAliasAnExternalModuleInsideAnInternalModule_file0'); module m_private { //import r2 = require('m'); // would be error export import C = r; // no error @@ -23,7 +23,7 @@ var m; })(m = exports.m || (exports.m = {})); //// [importAliasAnExternalModuleInsideAnInternalModule_file1.js] "use strict"; -var r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +var r = require('./importAliasAnExternalModuleInsideAnInternalModule_file0'); var m_private; (function (m_private) { //import r2 = require('m'); // would be error diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.symbols b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.symbols index e16057cf11a..ffaca4a0ec5 100644 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.symbols +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.symbols @@ -1,9 +1,9 @@ === tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts === -import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +import r = require('./importAliasAnExternalModuleInsideAnInternalModule_file0'); >r : Symbol(r, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 0, 0)) module m_private { ->m_private : Symbol(m_private, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 0, 78)) +>m_private : Symbol(m_private, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 0, 80)) //import r2 = require('m'); // would be error export import C = r; // no error diff --git a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.types b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.types index 3293b3139e4..34b71829d38 100644 --- a/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.types +++ b/tests/baselines/reference/importAliasAnExternalModuleInsideAnInternalModule.types @@ -1,5 +1,5 @@ === tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts === -import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +import r = require('./importAliasAnExternalModuleInsideAnInternalModule_file0'); >r : typeof r module m_private { diff --git a/tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule.ts b/tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule.ts index 99356afd3b7..0743ac6f4ca 100644 --- a/tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule.ts +++ b/tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule.ts @@ -4,7 +4,7 @@ export module m { } // @Filename: importAliasAnExternalModuleInsideAnInternalModule_file1.ts -import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0'); +import r = require('./importAliasAnExternalModuleInsideAnInternalModule_file0'); module m_private { //import r2 = require('m'); // would be error export import C = r; // no error diff --git a/tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts b/tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts index 8d166122b46..71b8a1eb1a2 100644 --- a/tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts +++ b/tests/cases/conformance/externalModules/relativePathToDeclarationFile.ts @@ -1,3 +1,4 @@ +// @ModuleResolution: classic // @Filename: test/foo.d.ts export declare module M2 { export var x: boolean; diff --git a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts index 09f580bb965..48a698c5a47 100644 --- a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts @@ -17,7 +17,7 @@ ////} //@Filename: findAllRefsOnDefinition.ts -////import Second = require("findAllRefsOnDefinition-import"); +////import Second = require("./findAllRefsOnDefinition-import"); //// ////var second = new Second.Test() ////second.start(); diff --git a/tests/cases/fourslash/cloduleAsBaseClass2.ts b/tests/cases/fourslash/cloduleAsBaseClass2.ts index be2072afc43..310ae72d664 100644 --- a/tests/cases/fourslash/cloduleAsBaseClass2.ts +++ b/tests/cases/fourslash/cloduleAsBaseClass2.ts @@ -15,7 +15,7 @@ ////export = A; // @Filename: cloduleAsBaseClass2_1.ts -////import B = require('cloduleAsBaseClass2_0'); +////import B = require('./cloduleAsBaseClass2_0'); ////class D extends B { //// constructor() { //// super(1); diff --git a/tests/cases/fourslash/commentsExternalModules.ts b/tests/cases/fourslash/commentsExternalModules.ts index 088a60d9119..c4bba7c444f 100644 --- a/tests/cases/fourslash/commentsExternalModules.ts +++ b/tests/cases/fourslash/commentsExternalModules.ts @@ -27,7 +27,7 @@ // @Filename: commentsExternalModules_file1.ts /////**This is on import declaration*/ -////import ex/*9*/tMod = require("commentsExternalModules_file0"); +////import ex/*9*/tMod = require("./commentsExternalModules_file0"); /////*10*/extMod./*11*/m1./*12*/fooExp/*13q*/ort(/*13*/); ////var new/*14*/Var = new extMod.m1.m2./*15*/c(); @@ -69,10 +69,10 @@ verify.memberListContains("i", "var m1.m2.i: m1.m2.c", "i"); goTo.file("commentsExternalModules_file1.ts"); goTo.marker('9'); -verify.quickInfoIs('import extMod = require("commentsExternalModules_file0")', "This is on import declaration"); +verify.quickInfoIs('import extMod = require("./commentsExternalModules_file0")', "This is on import declaration"); goTo.marker('10'); -verify.completionListContains("extMod", 'import extMod = require("commentsExternalModules_file0")', "This is on import declaration"); +verify.completionListContains("extMod", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration"); goTo.marker('11'); verify.memberListContains("m1", "namespace extMod.m1"); diff --git a/tests/cases/fourslash/commentsImportDeclaration.ts b/tests/cases/fourslash/commentsImportDeclaration.ts index 35c6d45330d..884c63253d4 100644 --- a/tests/cases/fourslash/commentsImportDeclaration.ts +++ b/tests/cases/fourslash/commentsImportDeclaration.ts @@ -20,7 +20,7 @@ // @Filename: commentsImportDeclaration_file1.ts /////// /////** Import declaration*/ -////import /*3*/extMod = require("commentsImportDeclaration_file0/*4*/"); +////import /*3*/extMod = require("./commentsImportDeclaration_file0/*4*/"); ////extMod./*6*/m1./*7*/fooEx/*8q*/port(/*8*/); ////var new/*9*/Var = new extMod.m1.m2./*10*/c(); @@ -28,7 +28,7 @@ goTo.marker('2'); verify.quickInfoIs("namespace m1", "NamespaceComment"); goTo.marker('3'); -verify.quickInfoIs('import extMod = require("commentsImportDeclaration_file0")', "Import declaration"); +verify.quickInfoIs('import extMod = require("./commentsImportDeclaration_file0")', "Import declaration"); goTo.marker('6'); verify.memberListContains("m1", "namespace extMod.m1"); diff --git a/tests/cases/fourslash/completionListForTransitivelyExportedMembers01.ts b/tests/cases/fourslash/completionListForTransitivelyExportedMembers01.ts index 017b04592c1..c9fe659cd91 100644 --- a/tests/cases/fourslash/completionListForTransitivelyExportedMembers01.ts +++ b/tests/cases/fourslash/completionListForTransitivelyExportedMembers01.ts @@ -24,11 +24,11 @@ // @Filename: C.ts ////export var cVar = "see!"; -////export * from "A"; -////export * from "B" +////export * from "./A"; +////export * from "./B" // @Filename: D.ts -////import * as c from "C"; +////import * as c from "./C"; ////var x = c./**/ goTo.marker(); diff --git a/tests/cases/fourslash/completionListForTransitivelyExportedMembers02.ts b/tests/cases/fourslash/completionListForTransitivelyExportedMembers02.ts index 868859746b4..6f2e2f490b1 100644 --- a/tests/cases/fourslash/completionListForTransitivelyExportedMembers02.ts +++ b/tests/cases/fourslash/completionListForTransitivelyExportedMembers02.ts @@ -25,11 +25,11 @@ // @Filename: C.ts ////export var cVar = "see!"; -////export * from "A"; -////export * from "B" +////export * from "./A"; +////export * from "./B" // @Filename: D.ts -////import * as c from "C"; +////import * as c from "./C"; ////var x = c.Inner./**/ goTo.marker(); diff --git a/tests/cases/fourslash/completionListForTransitivelyExportedMembers03.ts b/tests/cases/fourslash/completionListForTransitivelyExportedMembers03.ts index 78ef3ec7c72..ae92a706e50 100644 --- a/tests/cases/fourslash/completionListForTransitivelyExportedMembers03.ts +++ b/tests/cases/fourslash/completionListForTransitivelyExportedMembers03.ts @@ -25,11 +25,11 @@ // @Filename: C.ts ////export var cVar = "see!"; -////export * from "A"; -////export * from "B" +////export * from "./A"; +////export * from "./B" // @Filename: D.ts -////import * as c from "C"; +////import * as c from "./C"; ////var x: c./**/ goTo.marker(); diff --git a/tests/cases/fourslash/completionListForTransitivelyExportedMembers04.ts b/tests/cases/fourslash/completionListForTransitivelyExportedMembers04.ts index 114e370d31d..44f2bf224ad 100644 --- a/tests/cases/fourslash/completionListForTransitivelyExportedMembers04.ts +++ b/tests/cases/fourslash/completionListForTransitivelyExportedMembers04.ts @@ -1,5 +1,5 @@ /// - +// @ModuleResolution: classic // @Filename: A.ts ////export interface I1 { one: number } diff --git a/tests/cases/fourslash/completionListInExportClause01.ts b/tests/cases/fourslash/completionListInExportClause01.ts index 12726444bd2..741a1ac333c 100644 --- a/tests/cases/fourslash/completionListInExportClause01.ts +++ b/tests/cases/fourslash/completionListInExportClause01.ts @@ -6,11 +6,11 @@ ////export function baz() { return 10; } // @Filename: m2.ts -////export {/*1*/, /*2*/ from "m1" -////export {/*3*/} from "m1" -////export {foo,/*4*/ from "m1" -////export {bar as /*5*/, /*6*/ from "m1" -////export {foo, bar, baz as b,/*7*/} from "m1" +////export {/*1*/, /*2*/ from "./m1" +////export {/*3*/} from "./m1" +////export {foo,/*4*/ from "./m1" +////export {bar as /*5*/, /*6*/ from "./m1" +////export {foo, bar, baz as b,/*7*/} from "./m1" function verifyCompletionAtMarker(marker: string, showBuilder: boolean, ...completions: string[]) { goTo.marker(marker); diff --git a/tests/cases/fourslash/completionListInImportClause01.ts b/tests/cases/fourslash/completionListInImportClause01.ts index 2b679ffe550..fb2beadc566 100644 --- a/tests/cases/fourslash/completionListInImportClause01.ts +++ b/tests/cases/fourslash/completionListInImportClause01.ts @@ -1,4 +1,5 @@ /// +// @ModuleResolution: classic // @Filename: m1.ts ////export var foo: number = 1; diff --git a/tests/cases/fourslash/definition.ts b/tests/cases/fourslash/definition.ts index f403965fe12..13abe094376 100644 --- a/tests/cases/fourslash/definition.ts +++ b/tests/cases/fourslash/definition.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import n = require('a/*1*/'); +////import n = require('./a/*1*/'); ////var x = new n.Foo(); // @Filename: a.ts diff --git a/tests/cases/fourslash/exportEqualCallableInterface.ts b/tests/cases/fourslash/exportEqualCallableInterface.ts index 9ac54b31363..795df0c8695 100644 --- a/tests/cases/fourslash/exportEqualCallableInterface.ts +++ b/tests/cases/fourslash/exportEqualCallableInterface.ts @@ -9,7 +9,7 @@ // @Filename: exportEqualCallableInterface_file1.ts /////// -////import test = require('exportEqualCallableInterface_file0'); +////import test = require('./exportEqualCallableInterface_file0'); ////var t2: test; ////t2./**/ diff --git a/tests/cases/fourslash/exportEqualTypes.ts b/tests/cases/fourslash/exportEqualTypes.ts index 3fa3b71fef6..5da26aeb838 100644 --- a/tests/cases/fourslash/exportEqualTypes.ts +++ b/tests/cases/fourslash/exportEqualTypes.ts @@ -9,13 +9,13 @@ // @Filename: exportEqualTypes_file1.ts /////// -////import test = require('exportEqualTypes_file0'); +////import test = require('./exportEqualTypes_file0'); ////var t: /*1*/test; // var 't' should be of type 'test' ////var /*2*/r1 = t(); // Should return a Date ////var /*3*/r2 = t./*4*/foo; // t should have 'foo' in dropdown list and be of type 'string' goTo.marker('1'); -verify.quickInfoIs("import test = require('exportEqualTypes_file0')"); +verify.quickInfoIs("import test = require('./exportEqualTypes_file0')"); goTo.marker('2'); verify.quickInfoIs('var r1: Date'); goTo.marker('3'); diff --git a/tests/cases/fourslash/externalModuleIntellisense.ts b/tests/cases/fourslash/externalModuleIntellisense.ts index 4d909ceed21..93c7143a9c6 100644 --- a/tests/cases/fourslash/externalModuleIntellisense.ts +++ b/tests/cases/fourslash/externalModuleIntellisense.ts @@ -14,7 +14,7 @@ // @Filename: externalModuleIntellisense_file1.ts /////// -////import express = require('externalModuleIntellisense_file0'); +////import express = require('./externalModuleIntellisense_file0'); ////var x = express();/*1*/ goTo.marker('1'); diff --git a/tests/cases/fourslash/externalModuleWithExportAssignment.ts b/tests/cases/fourslash/externalModuleWithExportAssignment.ts index 09798ec5492..5d7e60f6ee5 100644 --- a/tests/cases/fourslash/externalModuleWithExportAssignment.ts +++ b/tests/cases/fourslash/externalModuleWithExportAssignment.ts @@ -18,7 +18,7 @@ ////export = m2; // @Filename: externalModuleWithExportAssignment_file1.ts -////import /*1*/a1 = require("externalModuleWithExportAssignment_file0"); +////import /*1*/a1 = require("./externalModuleWithExportAssignment_file0"); ////export var /*2*/a = a1; ////a./*3*/test1(/*4*/null, null, null); ////var /*6*/r1 = a.test2(/*5*/); @@ -30,7 +30,7 @@ goTo.file("externalModuleWithExportAssignment_file1.ts"); goTo.marker('1'); -verify.quickInfoIs('import a1 = require("externalModuleWithExportAssignment_file0")'); +verify.quickInfoIs('import a1 = require("./externalModuleWithExportAssignment_file0")'); goTo.marker('2'); verify.quickInfoIs("var a: {\n (): a1.connectExport;\n test1: a1.connectModule;\n test2(): a1.connectModule;\n}", undefined); diff --git a/tests/cases/fourslash/findAllRefsOnDefinition.ts b/tests/cases/fourslash/findAllRefsOnDefinition.ts index 34144b74899..a25a6e1285f 100644 --- a/tests/cases/fourslash/findAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/findAllRefsOnDefinition.ts @@ -17,7 +17,7 @@ ////} //@Filename: findAllRefsOnDefinition.ts -////import Second = require("findAllRefsOnDefinition-import"); +////import Second = require("./findAllRefsOnDefinition-import"); //// ////var second = new Second.Test() ////second.start(); diff --git a/tests/cases/fourslash/findAllRefsOnDefinition2.ts b/tests/cases/fourslash/findAllRefsOnDefinition2.ts index 1c03d392e4d..c9a116d4622 100644 --- a/tests/cases/fourslash/findAllRefsOnDefinition2.ts +++ b/tests/cases/fourslash/findAllRefsOnDefinition2.ts @@ -9,7 +9,7 @@ ////} //@Filename: findAllRefsOnDefinition2.ts -////import Second = require("findAllRefsOnDefinition2-import"); +////import Second = require("./findAllRefsOnDefinition2-import"); //// ////var start: Second.Test.start; ////var stop: Second.Test.stop; diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases.ts b/tests/cases/fourslash/findAllRefsOnImportAliases.ts index dbfab33aa86..8460e3f39b2 100644 --- a/tests/cases/fourslash/findAllRefsOnImportAliases.ts +++ b/tests/cases/fourslash/findAllRefsOnImportAliases.ts @@ -5,12 +5,12 @@ ////} //@Filename: b.ts -////import { /*2*/Class } from "a"; +////import { /*2*/Class } from "./a"; //// ////var c = new /*3*/Class(); //@Filename: c.ts -////export { /*4*/Class } from "a"; +////export { /*4*/Class } from "./a"; goTo.file("a.ts"); goTo.marker("1"); diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases2.ts b/tests/cases/fourslash/findAllRefsOnImportAliases2.ts index dca6b13bbd2..ab7a99e1e74 100644 --- a/tests/cases/fourslash/findAllRefsOnImportAliases2.ts +++ b/tests/cases/fourslash/findAllRefsOnImportAliases2.ts @@ -5,12 +5,12 @@ ////} //@Filename: b.ts -////import { /*2*/Class as /*3*/C2} from "a"; +////import { /*2*/Class as /*3*/C2} from "./a"; //// ////var c = new C2(); //@Filename: c.ts -////export { /*4*/Class as /*5*/C3 } from "a"; +////export { /*4*/Class as /*5*/C3 } from "./a"; goTo.file("a.ts"); goTo.marker("1"); diff --git a/tests/cases/fourslash/getJavaScriptCompletions15.ts b/tests/cases/fourslash/getJavaScriptCompletions15.ts index fbcbc2d4692..2903cb6fa7c 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions15.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions15.ts @@ -11,11 +11,11 @@ //// export var V = "123" // @Filename: main.js -//// import ref1 = require("refFile1"); -//// var ref2 = require("refFile2"); +//// import ref1 = require("./refFile1"); +//// var ref2 = require("./refFile2"); //// ref1.V./*1*/; //// ref2.V./*2*/; -//// var v = { x: require("refFile3") }; +//// var v = { x: require("./refFile3") }; //// v.x./*3*/; //// v.x.V./*4*/; diff --git a/tests/cases/fourslash/getPreProcessedFile.ts b/tests/cases/fourslash/getPreProcessedFile.ts index aa0ff4c0669..03ce481c8ba 100644 --- a/tests/cases/fourslash/getPreProcessedFile.ts +++ b/tests/cases/fourslash/getPreProcessedFile.ts @@ -1,4 +1,5 @@ /// +// @ModuleResolution: classic // @Filename: refFile1.ts //// class D { } diff --git a/tests/cases/fourslash/goToDefinitionExternalModuleName.ts b/tests/cases/fourslash/goToDefinitionExternalModuleName.ts index f403965fe12..13abe094376 100644 --- a/tests/cases/fourslash/goToDefinitionExternalModuleName.ts +++ b/tests/cases/fourslash/goToDefinitionExternalModuleName.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import n = require('a/*1*/'); +////import n = require('./a/*1*/'); ////var x = new n.Foo(); // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionExternalModuleName2.ts b/tests/cases/fourslash/goToDefinitionExternalModuleName2.ts index df7b3310394..06be8e676dd 100644 --- a/tests/cases/fourslash/goToDefinitionExternalModuleName2.ts +++ b/tests/cases/fourslash/goToDefinitionExternalModuleName2.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import n = require('a/*1*/'); +////import n = require('./a/*1*/'); ////var x = new n.Foo(); // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames.ts b/tests/cases/fourslash/goToDefinitionImportedNames.ts index 64eb2df96bf..98a791d23ae 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////export {/*classAliasDefinition*/Class} from "a"; +////export {/*classAliasDefinition*/Class} from "./a"; // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames2.ts b/tests/cases/fourslash/goToDefinitionImportedNames2.ts index 8533dad62a8..e5ab58d10cf 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames2.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames2.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import {/*classAliasDefinition*/Class} from "a"; +////import {/*classAliasDefinition*/Class} from "./a"; // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames3.ts b/tests/cases/fourslash/goToDefinitionImportedNames3.ts index 70fce1749e4..5e9376d70cb 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames3.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames3.ts @@ -1,20 +1,20 @@ /// // @Filename: e.ts -//// import {M, /*classAliasDefinition*/C, I} from "d"; +//// import {M, /*classAliasDefinition*/C, I} from "./d"; //// var c = new /*classReference*/C(); // @Filename: d.ts -////export * from "c"; +////export * from "./c"; // @Filename: c.ts -////export {Module as M, Class as C, Interface as I} from "b"; +////export {Module as M, Class as C, Interface as I} from "./b"; // @Filename: b.ts -////export * from "a"; +////export * from "./a"; // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames4.ts b/tests/cases/fourslash/goToDefinitionImportedNames4.ts index cce49af874b..e0ef512dc41 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames4.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames4.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import {Class as /*classAliasDefinition*/ClassAlias} from "a"; +////import {Class as /*classAliasDefinition*/ClassAlias} from "./a"; // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames5.ts b/tests/cases/fourslash/goToDefinitionImportedNames5.ts index 46a8c45e272..abd3bee998a 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames5.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames5.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////export {Class as /*classAliasDefinition*/ClassAlias} from "a"; +////export {Class as /*classAliasDefinition*/ClassAlias} from "./a"; // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames6.ts b/tests/cases/fourslash/goToDefinitionImportedNames6.ts index 27b6c55d107..c665946c3b1 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames6.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames6.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import /*moduleAliasDefinition*/alias = require("a"); +////import /*moduleAliasDefinition*/alias = require("./a"); // @Filename: a.ts diff --git a/tests/cases/fourslash/goToDefinitionImportedNames7.ts b/tests/cases/fourslash/goToDefinitionImportedNames7.ts index 3c367600b1f..d5bcc499c7c 100644 --- a/tests/cases/fourslash/goToDefinitionImportedNames7.ts +++ b/tests/cases/fourslash/goToDefinitionImportedNames7.ts @@ -1,7 +1,7 @@ /// // @Filename: b.ts -////import /*classAliasDefinition*/defaultExport from "a"; +////import /*classAliasDefinition*/defaultExport from "./a"; // @Filename: a.ts diff --git a/tests/cases/fourslash/goToTypeDefinitionAliases.ts b/tests/cases/fourslash/goToTypeDefinitionAliases.ts index 19abc22ca30..da9d3d5a84e 100644 --- a/tests/cases/fourslash/goToTypeDefinitionAliases.ts +++ b/tests/cases/fourslash/goToTypeDefinitionAliases.ts @@ -7,12 +7,12 @@ ////export {I as I2}; // @Filename: goToTypeDefinitioAliases_module2.ts -////import {I2 as I3} from "goToTypeDefinitioAliases_module1"; +////import {I2 as I3} from "./goToTypeDefinitioAliases_module1"; ////var v1: I3; ////export {v1 as v2}; // @Filename: goToTypeDefinitioAliases_module3.ts -////import {/*reference1*/v2 as v3} from "goToTypeDefinitioAliases_module2"; +////import {/*reference1*/v2 as v3} from "./goToTypeDefinitioAliases_module2"; /////*reference2*/v3; goTo.marker('reference1'); diff --git a/tests/cases/fourslash/javaScriptModules13.ts b/tests/cases/fourslash/javaScriptModules13.ts index cb3ef36783f..bcf263a4b8c 100644 --- a/tests/cases/fourslash/javaScriptModules13.ts +++ b/tests/cases/fourslash/javaScriptModules13.ts @@ -13,7 +13,7 @@ //// var y = 10; // @Filename: consumer.js -//// var x = require('myMod'); +//// var x = require('./myMod'); //// /**/; goTo.file('consumer.js'); diff --git a/tests/cases/fourslash/javaScriptModules15.ts b/tests/cases/fourslash/javaScriptModules15.ts index 5cd7545c83d..0636f0360af 100644 --- a/tests/cases/fourslash/javaScriptModules15.ts +++ b/tests/cases/fourslash/javaScriptModules15.ts @@ -14,7 +14,7 @@ //// } // @Filename: consumer.js -//// var x = require('myMod'); +//// var x = require('./myMod'); //// x/**/; goTo.file('consumer.js'); diff --git a/tests/cases/fourslash/javaScriptModules16.ts b/tests/cases/fourslash/javaScriptModules16.ts index c34660df59f..09a777f7d2c 100644 --- a/tests/cases/fourslash/javaScriptModules16.ts +++ b/tests/cases/fourslash/javaScriptModules16.ts @@ -9,7 +9,7 @@ //// exports.b = true; // @Filename: consumer.js -//// var x = require('myMod'); +//// var x = require('./myMod'); //// x/**/; goTo.file('consumer.js'); diff --git a/tests/cases/fourslash/javaScriptModules19.ts b/tests/cases/fourslash/javaScriptModules19.ts index 91e2439dcc9..564cbea722f 100644 --- a/tests/cases/fourslash/javaScriptModules19.ts +++ b/tests/cases/fourslash/javaScriptModules19.ts @@ -11,7 +11,7 @@ //// var y = 10; // @Filename: consumer.js -//// var x = require('myMod'); +//// var x = require('./myMod'); //// /**/; goTo.file('consumer.js'); diff --git a/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts b/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts index c93c8292138..42171ff2e8b 100644 --- a/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts +++ b/tests/cases/fourslash/memberListOfEnumFromExternalModule.ts @@ -5,7 +5,7 @@ ////var topic = Topic.One; // @Filename: memberListOfEnumFromExternalModule_file1.ts -////import t = require('memberListOfEnumFromExternalModule_file0'); +////import t = require('./memberListOfEnumFromExternalModule_file0'); ////var topic = t.Topic./*1*/ goTo.file("memberListOfEnumFromExternalModule_file1.ts"); diff --git a/tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts b/tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts index 00b9aaf8447..791f519aa28 100644 --- a/tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts +++ b/tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts @@ -11,7 +11,7 @@ // @Filename: mergedDeclarationsWithExportAssignment1_file1.ts /////// -////import /*1*/Foo = require('mergedDeclarationsWithExportAssignment1_file0'); +////import /*1*/Foo = require('./mergedDeclarationsWithExportAssignment1_file0'); ////var /*3*/z = new /*2*/Foo(); ////var /*5*/r2 = Foo./*4*/x; @@ -19,7 +19,7 @@ edit.insert(''); goTo.marker('1'); -verify.quickInfoIs("import Foo = require('mergedDeclarationsWithExportAssignment1_file0')"); +verify.quickInfoIs("import Foo = require('./mergedDeclarationsWithExportAssignment1_file0')"); goTo.marker('2'); verify.completionListContains('Foo'); diff --git a/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts b/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts index 77e12476574..36ca4edac8d 100644 --- a/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts +++ b/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias.ts @@ -7,9 +7,9 @@ ////} // @Filename: quickInfoDisplayPartsExternalModuleAlias_file1.ts -////import /*1*/a1 = require(/*mod1*/"quickInfoDisplayPartsExternalModuleAlias_file0"); +////import /*1*/a1 = require(/*mod1*/"./quickInfoDisplayPartsExternalModuleAlias_file0"); ////new /*2*/a1.m1.c(); -////export import /*3*/a2 = require(/*mod2*/"quickInfoDisplayPartsExternalModuleAlias_file0"); +////export import /*3*/a2 = require(/*mod2*/"./quickInfoDisplayPartsExternalModuleAlias_file0"); ////new /*4*/a2.m1.c(); var marker = 0; @@ -24,7 +24,7 @@ function verifyImport(name: string, isExported: boolean) { [{ text: "import", kind: "keyword" }, { text: " ", kind: "space" }, { text: name, kind: "aliasName" }, { text: " ", kind: "space" }, { text: "=", kind: "operator" }, { text: " ", kind: "space" }, { text: "require", kind: "keyword" }, { text: "(", kind: "punctuation" }, - { text: "\"quickInfoDisplayPartsExternalModuleAlias_file0\"", kind: "stringLiteral" }, + { text: "\"./quickInfoDisplayPartsExternalModuleAlias_file0\"", kind: "stringLiteral" }, { text: ")", kind: "punctuation" }], []); } @@ -35,7 +35,7 @@ verifyImport("a2", /*isExported*/true); function verifyExternalModuleStringLiteral(marker: string) { goTo.marker(marker); - verify.verifyQuickInfoDisplayParts("module", "", { start: test.markerByName(marker).position, length: "\"quickInfoDisplayPartsExternalModuleAlias_file0\"".length }, + verify.verifyQuickInfoDisplayParts("module", "", { start: test.markerByName(marker).position, length: "\"./quickInfoDisplayPartsExternalModuleAlias_file0\"".length }, [{ text: "module", kind: "keyword" }, { text: " ", kind: "space" }, { text: "a1", kind: "aliasName" }], []); } diff --git a/tests/cases/fourslash/quickInfoExportAssignmentOfGenericInterface.ts b/tests/cases/fourslash/quickInfoExportAssignmentOfGenericInterface.ts index bf77d12669f..e0b67a9f47d 100644 --- a/tests/cases/fourslash/quickInfoExportAssignmentOfGenericInterface.ts +++ b/tests/cases/fourslash/quickInfoExportAssignmentOfGenericInterface.ts @@ -7,7 +7,7 @@ ////export = Foo; // @Filename: quickInfoExportAssignmentOfGenericInterface_1.ts -////import a = require('quickInfoExportAssignmentOfGenericInterface_0'); +////import a = require('./quickInfoExportAssignmentOfGenericInterface_0'); ////export var /*1*/x: a>; ////x.a; diff --git a/tests/cases/fourslash/quickInfoForRequire.ts b/tests/cases/fourslash/quickInfoForRequire.ts index 91d59cb4318..8e714c08736 100644 --- a/tests/cases/fourslash/quickInfoForRequire.ts +++ b/tests/cases/fourslash/quickInfoForRequire.ts @@ -4,7 +4,7 @@ ////export class a{} //@Filename: quickInfoForRequire_input.ts -////import a = require("AA/B/*1*/B"); +////import a = require("./AA/B/*1*/B"); goTo.marker('1'); verify.quickInfoIs('module a'); diff --git a/tests/cases/fourslash/selfReferencedExternalModule.ts b/tests/cases/fourslash/selfReferencedExternalModule.ts index 39d785ffb0d..3c96c320784 100644 --- a/tests/cases/fourslash/selfReferencedExternalModule.ts +++ b/tests/cases/fourslash/selfReferencedExternalModule.ts @@ -1,9 +1,9 @@ /// // @Filename: app.ts -////export import A = require('app'); +////export import A = require('./app'); ////export var I = 1; ////A./**/I goTo.marker(); -verify.completionListContains("A", "import A = require('app')"); +verify.completionListContains("A", "import A = require('./app')"); verify.completionListContains("I", "var I: number"); diff --git a/tests/cases/fourslash/selfReferencedExternalModule2.ts b/tests/cases/fourslash/selfReferencedExternalModule2.ts index ab1f7a6c901..698cfdde11f 100644 --- a/tests/cases/fourslash/selfReferencedExternalModule2.ts +++ b/tests/cases/fourslash/selfReferencedExternalModule2.ts @@ -1,12 +1,12 @@ /// // @Filename: app.ts -////export import A = require('app2'); +////export import A = require('./app2'); ////export var I = 1; ////A./*1*/Y; ////A.B.A.B./*2*/I; // @Filename: app2.ts -////export import B = require('app'); +////export import B = require('./app'); ////export var Y = 1; goTo.marker("1"); diff --git a/tests/cases/fourslash/shims-pp/getPreProcessedFile.ts b/tests/cases/fourslash/shims-pp/getPreProcessedFile.ts index aa0ff4c0669..03ce481c8ba 100644 --- a/tests/cases/fourslash/shims-pp/getPreProcessedFile.ts +++ b/tests/cases/fourslash/shims-pp/getPreProcessedFile.ts @@ -1,4 +1,5 @@ /// +// @ModuleResolution: classic // @Filename: refFile1.ts //// class D { } diff --git a/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts b/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts index 34144b74899..a25a6e1285f 100644 --- a/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts +++ b/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts @@ -17,7 +17,7 @@ ////} //@Filename: findAllRefsOnDefinition.ts -////import Second = require("findAllRefsOnDefinition-import"); +////import Second = require("./findAllRefsOnDefinition-import"); //// ////var second = new Second.Test() ////second.start(); diff --git a/tests/cases/fourslash/shims/getPreProcessedFile.ts b/tests/cases/fourslash/shims/getPreProcessedFile.ts index aa0ff4c0669..03ce481c8ba 100644 --- a/tests/cases/fourslash/shims/getPreProcessedFile.ts +++ b/tests/cases/fourslash/shims/getPreProcessedFile.ts @@ -1,4 +1,5 @@ /// +// @ModuleResolution: classic // @Filename: refFile1.ts //// class D { } diff --git a/tests/cases/fourslash/shims/getReferencesAtPosition.ts b/tests/cases/fourslash/shims/getReferencesAtPosition.ts index 34144b74899..a25a6e1285f 100644 --- a/tests/cases/fourslash/shims/getReferencesAtPosition.ts +++ b/tests/cases/fourslash/shims/getReferencesAtPosition.ts @@ -17,7 +17,7 @@ ////} //@Filename: findAllRefsOnDefinition.ts -////import Second = require("findAllRefsOnDefinition-import"); +////import Second = require("./findAllRefsOnDefinition-import"); //// ////var second = new Second.Test() ////second.start(); diff --git a/tests/cases/fourslash/verifySingleFileEmitOutput1.ts b/tests/cases/fourslash/verifySingleFileEmitOutput1.ts index f1c9002390f..1921a6fe053 100644 --- a/tests/cases/fourslash/verifySingleFileEmitOutput1.ts +++ b/tests/cases/fourslash/verifySingleFileEmitOutput1.ts @@ -7,7 +7,7 @@ ////} // @Filename: verifySingleFileEmitOutput1_file1.ts -////import f = require("verifySingleFileEmitOutput1_file0"); +////import f = require("./verifySingleFileEmitOutput1_file0"); ////var /**/b = new f.A(); goTo.marker(); From 1121098c5649006cbdb3dbeac750795b71ac9ed6 Mon Sep 17 00:00:00 2001 From: Bill Ticehurst Date: Fri, 12 Feb 2016 17:21:51 -0800 Subject: [PATCH 4/5] Remove unnecessary option from harness --- src/harness/harness.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 4db1a815e9a..2b17195cfb1 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -896,8 +896,7 @@ namespace Harness { { name: "fileName", type: "string" }, { name: "libFiles", type: "string" }, { name: "noErrorTruncation", type: "boolean" }, - { name: "suppressOutputPathCheck", type: "boolean" }, - { name: "moduleResolution", type: "string"} + { name: "suppressOutputPathCheck", type: "boolean" } ]; let optionsIndex: ts.Map; From 60228d93e80352ddc4342d5990318fc3c0985b69 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 12 Feb 2016 17:23:27 -0800 Subject: [PATCH 5/5] Ignore using the correct glob. --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 78d9a92997c..db8e29d903a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,9 +28,9 @@ build.json *.actual tests/webhost/*.d.ts tests/webhost/webtsc.js -tests/**/*.js -tests/**/*.js.map -tests/**/*.d.ts +tests/cases/**/*.js +tests/cases/**/*.js.map +tests/cases/**/*.d.ts *.config scripts/debug.bat scripts/run.bat