diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt b/tests/baselines/reference/computedPropertyNames36_ES5.errors.txt index 506a9ca15d1..6c38043c8e0 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,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +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 (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 cf50807ac54..8127898fde4 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,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +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 (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 2e5313caa41..acc08ee5527 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,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(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 (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 4c6e78c5b04..0a95b37f9a9 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,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(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 (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 a204ef4ae34..669314676f9 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,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(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 (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 d2e2494c87a..38f432162d5 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,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(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 (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 d777ae659de..62c239a5a54 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,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +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 (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 6af43ebfa5c..0efe0ba39ec 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,9): error TS2411: Property '["get1"]' of type 'Foo' is not assignable to string index type 'Foo2'. +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 (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 43801ab3d62..35ab422e093 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,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(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 (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 28b861347a3..5170746395c 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,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(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 (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 f06d199ba5a..8baae68f337 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,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(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 (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 626ed14ad1a..e329785f4cf 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,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(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 (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 a16cbfe7b37..6c55f966eee 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType.errors.txt @@ -1,21 +1,23 @@ +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(2,9): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType.ts(5,5): 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 c9fae8cc89c..5cdb9b3a36f 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(5,9): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): 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,22 +12,26 @@ 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. - ~ -!!! error TS2380: 'get' and 'set' accessor must have the same type. return this.data; + ~~~~~~~~~~~~~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS2380: 'get' and 'set' accessor must have the same type. 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 3fb17d65a40..0aac384f7c3 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(5,9): error TS2380: 'get' and 'set' accessor must have the same type. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): 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,22 +12,26 @@ 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. - ~ -!!! error TS2380: 'get' and 'set' accessor must have the same type. return this.data; + ~~~~~~~~~~~~~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS2380: 'get' and 'set' accessor must have the same type. 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 bb43d96b003..36538aef4f3 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,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(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 (11 errors) ==== @@ -78,9 +78,11 @@ tests/cases/compiler/implicitAnyFromCircularInference.ts(46,9): error TS7023: 'x class D { // Error expected get 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; + ~~~~~~~~~~~~~~~~~~~~~~ } + ~~~~~ +!!! 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. } \ No newline at end of file diff --git a/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt b/tests/baselines/reference/implicitAnyGetAndSetAccessorWithAnyReturnType.errors.txt index 460ff97b10e..4d9008cd56a 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,21 +30,24 @@ 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. - ~~~~~~~~~~~ -!!! error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. return null; + ~~~~~~~~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS7010: 'haveOnlyGet', which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 134b79a443e..19935f52bdc 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,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(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(44,29): error TS2322: Type 'number' is not assignable to type 'string'. -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(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 (96 errors) ==== @@ -322,16 +322,16 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55) // 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