-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retain errorType when it is used as a marker for the lack of a constr…
…aint
- Loading branch information
Showing
7 changed files
with
70 additions
and
710 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. | ||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. | ||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. | ||
Index signatures are incompatible. | ||
Type 'string | number' is not assignable to type 'boolean'. | ||
Type 'string' is not assignable to type 'boolean'. | ||
|
||
|
||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (2 errors) ==== | ||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ==== | ||
interface I { | ||
[s: string]: boolean; | ||
[s: number]: boolean; | ||
} | ||
|
||
var o: I = { | ||
~ | ||
!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. | ||
!!! error TS2322: Index signatures are incompatible. | ||
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. | ||
!!! error TS2322: Type 'string' is not assignable to type 'boolean'. | ||
[+"foo"]: "", | ||
~~~~~~~~ | ||
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. | ||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts:2:5: The expected type comes from this index signature. | ||
[+"bar"]: 0 | ||
~~~~~~~~ | ||
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. | ||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts:2:5: The expected type comes from this index signature. | ||
} |
19 changes: 10 additions & 9 deletions
19
tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. | ||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. | ||
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. | ||
Index signatures are incompatible. | ||
Type 'string | number' is not assignable to type 'boolean'. | ||
Type 'string' is not assignable to type 'boolean'. | ||
|
||
|
||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (2 errors) ==== | ||
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (1 errors) ==== | ||
interface I { | ||
[s: string]: boolean; | ||
[s: number]: boolean; | ||
} | ||
|
||
var o: I = { | ||
~ | ||
!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. | ||
!!! error TS2322: Index signatures are incompatible. | ||
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. | ||
!!! error TS2322: Type 'string' is not assignable to type 'boolean'. | ||
[+"foo"]: "", | ||
~~~~~~~~ | ||
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'. | ||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts:2:5: The expected type comes from this index signature. | ||
[+"bar"]: 0 | ||
~~~~~~~~ | ||
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'. | ||
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts:2:5: The expected type comes from this index signature. | ||
} |
Oops, something went wrong.