forked from microsoft/TypeScript
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f526e16
commit cbf4be5
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
tests/baselines/reference/substitutionTypePassedToExtends.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
tests/cases/compiler/substitutionTypePassedToExtends.ts(4,16): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
tests/cases/compiler/substitutionTypePassedToExtends.ts(4,31): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
tests/cases/compiler/substitutionTypePassedToExtends.ts(4,53): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
tests/cases/compiler/substitutionTypePassedToExtends.ts(5,21): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
|
||
|
||
==== tests/cases/compiler/substitutionTypePassedToExtends.ts (4 errors) ==== | ||
type Foo1<A,B> = [A, B] extends unknown[][] ? Bar1<[A, B]> : 'else' | ||
type Bar1<T extends unknown[][]> = T | ||
|
||
type Foo2<A> = Set<A> extends Set<unknown[]> ? Bar2<Set<A>> : 'else' | ||
~~~ | ||
!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
~~~ | ||
!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
~~~ | ||
!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
type Bar2<T extends Set<unknown[]>> = T | ||
~~~ | ||
!!! error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. | ||
|
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/substitutionTypePassedToExtends.js
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 @@ | ||
//// [substitutionTypePassedToExtends.ts] | ||
type Foo1<A,B> = [A, B] extends unknown[][] ? Bar1<[A, B]> : 'else' | ||
type Bar1<T extends unknown[][]> = T | ||
|
||
type Foo2<A> = Set<A> extends Set<unknown[]> ? Bar2<Set<A>> : 'else' | ||
type Bar2<T extends Set<unknown[]>> = T | ||
|
||
|
||
//// [substitutionTypePassedToExtends.js] | ||
"use strict"; |
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/substitutionTypePassedToExtends.symbols
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,32 @@ | ||
=== tests/cases/compiler/substitutionTypePassedToExtends.ts === | ||
type Foo1<A,B> = [A, B] extends unknown[][] ? Bar1<[A, B]> : 'else' | ||
>Foo1 : Symbol(Foo1, Decl(substitutionTypePassedToExtends.ts, 0, 0)) | ||
>A : Symbol(A, Decl(substitutionTypePassedToExtends.ts, 0, 10)) | ||
>B : Symbol(B, Decl(substitutionTypePassedToExtends.ts, 0, 12)) | ||
>A : Symbol(A, Decl(substitutionTypePassedToExtends.ts, 0, 10)) | ||
>B : Symbol(B, Decl(substitutionTypePassedToExtends.ts, 0, 12)) | ||
>Bar1 : Symbol(Bar1, Decl(substitutionTypePassedToExtends.ts, 0, 67)) | ||
>A : Symbol(A, Decl(substitutionTypePassedToExtends.ts, 0, 10)) | ||
>B : Symbol(B, Decl(substitutionTypePassedToExtends.ts, 0, 12)) | ||
|
||
type Bar1<T extends unknown[][]> = T | ||
>Bar1 : Symbol(Bar1, Decl(substitutionTypePassedToExtends.ts, 0, 67)) | ||
>T : Symbol(T, Decl(substitutionTypePassedToExtends.ts, 1, 10)) | ||
>T : Symbol(T, Decl(substitutionTypePassedToExtends.ts, 1, 10)) | ||
|
||
type Foo2<A> = Set<A> extends Set<unknown[]> ? Bar2<Set<A>> : 'else' | ||
>Foo2 : Symbol(Foo2, Decl(substitutionTypePassedToExtends.ts, 1, 36)) | ||
>A : Symbol(A, Decl(substitutionTypePassedToExtends.ts, 3, 10)) | ||
>Set : Symbol(Set) | ||
>A : Symbol(A, Decl(substitutionTypePassedToExtends.ts, 3, 10)) | ||
>Set : Symbol(Set) | ||
>Bar2 : Symbol(Bar2, Decl(substitutionTypePassedToExtends.ts, 3, 68)) | ||
>Set : Symbol(Set) | ||
>A : Symbol(A, Decl(substitutionTypePassedToExtends.ts, 3, 10)) | ||
|
||
type Bar2<T extends Set<unknown[]>> = T | ||
>Bar2 : Symbol(Bar2, Decl(substitutionTypePassedToExtends.ts, 3, 68)) | ||
>T : Symbol(T, Decl(substitutionTypePassedToExtends.ts, 4, 10)) | ||
>Set : Symbol(Set) | ||
>T : Symbol(T, Decl(substitutionTypePassedToExtends.ts, 4, 10)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/substitutionTypePassedToExtends.types
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,13 @@ | ||
=== tests/cases/compiler/substitutionTypePassedToExtends.ts === | ||
type Foo1<A,B> = [A, B] extends unknown[][] ? Bar1<[A, B]> : 'else' | ||
>Foo1 : Foo1<A, B> | ||
|
||
type Bar1<T extends unknown[][]> = T | ||
>Bar1 : T | ||
|
||
type Foo2<A> = Set<A> extends Set<unknown[]> ? Bar2<Set<A>> : 'else' | ||
>Foo2 : Set<A> | ||
|
||
type Bar2<T extends Set<unknown[]>> = T | ||
>Bar2 : T | ||
|
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,7 @@ | ||
// @strict: true | ||
|
||
type Foo1<A,B> = [A, B] extends unknown[][] ? Bar1<[A, B]> : 'else' | ||
type Bar1<T extends unknown[][]> = T | ||
|
||
type Foo2<A> = Set<A> extends Set<unknown[]> ? Bar2<Set<A>> : 'else' | ||
type Bar2<T extends Set<unknown[]>> = T |