-
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.
Merge pull request #5517 from Microsoft/comparableRelation
Introduce the "comparable" relation
- Loading branch information
Showing
43 changed files
with
780 additions
and
99 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
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
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
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,8 +1,8 @@ | ||
tests/cases/conformance/expressions/asOperator/asOperator2.ts(1,9): error TS2352: Neither type 'number' nor type 'string' is assignable to the other. | ||
tests/cases/conformance/expressions/asOperator/asOperator2.ts(1,9): error TS2352: Type 'number' cannot be converted to type 'string'. | ||
|
||
|
||
==== tests/cases/conformance/expressions/asOperator/asOperator2.ts (1 errors) ==== | ||
var x = 23 as string; | ||
~~~~~~~~~~~~ | ||
!!! error TS2352: Neither type 'number' nor type 'string' is assignable to the other. | ||
!!! error TS2352: Type 'number' cannot be converted to type 'string'. | ||
|
8 changes: 4 additions & 4 deletions
8
tests/baselines/reference/asOperatorContextualType.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,10 +1,10 @@ | ||
tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts(2,9): error TS2352: Neither type '(v: number) => number' nor type '(x: number) => string' is assignable to the other. | ||
Type 'number' is not assignable to type 'string'. | ||
tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts(2,9): error TS2352: Type '(v: number) => number' cannot be converted to type '(x: number) => string'. | ||
Type 'number' is not comparable to type 'string'. | ||
|
||
|
||
==== tests/cases/conformance/expressions/asOperator/asOperatorContextualType.ts (1 errors) ==== | ||
// should error | ||
var x = (v => v) as (x: number) => string; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2352: Neither type '(v: number) => number' nor type '(x: number) => string' is assignable to the other. | ||
!!! error TS2352: Type 'number' is not assignable to type 'string'. | ||
!!! error TS2352: Type '(v: number) => number' cannot be converted to type '(x: number) => string'. | ||
!!! error TS2352: Type 'number' is not comparable to type 'string'. |
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,11 +1,11 @@ | ||
tests/cases/conformance/expressions/asOperator/asOperatorNames.ts(2,9): error TS2352: Neither type 'number' nor type 'string' is assignable to the other. | ||
tests/cases/conformance/expressions/asOperator/asOperatorNames.ts(2,9): error TS2352: Type 'number' cannot be converted to type 'string'. | ||
|
||
|
||
==== tests/cases/conformance/expressions/asOperator/asOperatorNames.ts (1 errors) ==== | ||
var a = 20; | ||
var b = a as string; | ||
~~~~~~~~~~~ | ||
!!! error TS2352: Neither type 'number' nor type 'string' is assignable to the other. | ||
!!! error TS2352: Type 'number' cannot be converted to type 'string'. | ||
var as = "hello"; | ||
var as1 = as as string; | ||
|
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
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,9 +1,9 @@ | ||
tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. | ||
Type 'string' is not assignable to type 'number'. | ||
tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Type '() => string' cannot be converted to type '() => number'. | ||
Type 'string' is not comparable to type 'number'. | ||
|
||
|
||
==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== | ||
var foo = <{ (): number; }> function() { return "err"; }; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. | ||
!!! error TS2352: Type 'string' is not assignable to type 'number'. | ||
!!! error TS2352: Type '() => string' cannot be converted to type '() => number'. | ||
!!! error TS2352: Type 'string' is not comparable to type 'number'. |
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,9 +1,9 @@ | ||
tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. | ||
Type 'string' is not assignable to type 'number'. | ||
tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Type '() => string' cannot be converted to type '{ (): number; (i: number): number; }'. | ||
Type 'string' is not comparable to type 'number'. | ||
|
||
|
||
==== tests/cases/compiler/contextualTyping41.ts (1 errors) ==== | ||
var foo = <{():number; (i:number):number; }> (function(){return "err";}); | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. | ||
!!! error TS2352: Type 'string' is not assignable to type 'number'. | ||
!!! error TS2352: Type '() => string' cannot be converted to type '{ (): number; (i: number): number; }'. | ||
!!! error TS2352: Type 'string' is not comparable to type 'number'. |
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
Oops, something went wrong.