Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(typescript-estree): add tests for
satisfies
- Loading branch information
1 parent
41f15e1
commit d60f18b
Showing
4 changed files
with
3,208 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
packages/shared-fixtures/fixtures/typescript/expressions/satisfies-expression.src.ts
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
x satisfies T; | ||
x < y satisfies boolean; // (x < y) satisfies boolean; | ||
x === 1 satisfies number; // x === (1 satisfies number); | ||
x satisfies any satisfies T; | ||
|
||
const t2 = { a: 1, b: 1 } satisfies I1; // Error | ||
const t3 = { } satisfies I1; // Error | ||
const t4: T1 = { a: "a" } satisfies T1; // Ok | ||
const t5 = (m => m.substring(0)) satisfies T2; // Ok | ||
const t6 = [1, 2] satisfies [number, 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
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.