-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/microsoft/TypeScript into f…
…eat/51086
- Loading branch information
Showing
9 changed files
with
131 additions
and
4 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
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/unmetTypeConstraintInImportCall.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,12 @@ | ||
tests/cases/compiler/file2.ts(1,37): error TS2344: Type 'T' does not satisfy the constraint 'string'. | ||
|
||
|
||
==== tests/cases/compiler/file1.ts (0 errors) ==== | ||
export type Foo<T extends string> = { foo: T } | ||
|
||
==== tests/cases/compiler/file2.ts (1 errors) ==== | ||
type Bar<T> = import('./file1').Foo<T>; | ||
~ | ||
!!! error TS2344: Type 'T' does not satisfy the constraint 'string'. | ||
!!! related TS2208 tests/cases/compiler/file2.ts:1:10: This type parameter might need an `extends string` constraint. | ||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/unmetTypeConstraintInImportCall.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,14 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
export type Foo<T extends string> = { foo: T } | ||
>Foo : Symbol(Foo, Decl(file1.ts, 0, 0)) | ||
>T : Symbol(T, Decl(file1.ts, 0, 16)) | ||
>foo : Symbol(foo, Decl(file1.ts, 0, 37)) | ||
>T : Symbol(T, Decl(file1.ts, 0, 16)) | ||
|
||
=== tests/cases/compiler/file2.ts === | ||
type Bar<T> = import('./file1').Foo<T>; | ||
>Bar : Symbol(Bar, Decl(file2.ts, 0, 0)) | ||
>T : Symbol(T, Decl(file2.ts, 0, 9)) | ||
>Foo : Symbol(Foo, Decl(file1.ts, 0, 0)) | ||
>T : Symbol(T, Decl(file2.ts, 0, 9)) | ||
|
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/unmetTypeConstraintInImportCall.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,9 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
export type Foo<T extends string> = { foo: T } | ||
>Foo : Foo<T> | ||
>foo : T | ||
|
||
=== tests/cases/compiler/file2.ts === | ||
type Bar<T> = import('./file1').Foo<T>; | ||
>Bar : Bar<T> | ||
|
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/unmetTypeConstraintInJSDocImportCall.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,20 @@ | ||
tests/cases/compiler/file2.js(3,36): error TS2344: Type 'T' does not satisfy the constraint 'string'. | ||
|
||
|
||
==== tests/cases/compiler/file1.js (0 errors) ==== | ||
/** | ||
* @template {string} T | ||
* @typedef {{ foo: T }} Foo | ||
*/ | ||
|
||
export default {}; | ||
|
||
==== tests/cases/compiler/file2.js (1 errors) ==== | ||
/** | ||
* @template T | ||
* @typedef {import('./file1').Foo<T>} Bar | ||
~ | ||
!!! error TS2344: Type 'T' does not satisfy the constraint 'string'. | ||
!!! related TS2208 tests/cases/compiler/file2.js:2:14: This type parameter might need an `extends string` constraint. | ||
*/ | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/unmetTypeConstraintInJSDocImportCall.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,16 @@ | ||
=== tests/cases/compiler/file1.js === | ||
|
||
/** | ||
* @template {string} T | ||
* @typedef {{ foo: T }} Foo | ||
*/ | ||
|
||
export default {}; | ||
|
||
=== tests/cases/compiler/file2.js === | ||
|
||
/** | ||
* @template T | ||
* @typedef {import('./file1').Foo<T>} Bar | ||
*/ | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/unmetTypeConstraintInJSDocImportCall.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,16 @@ | ||
=== tests/cases/compiler/file1.js === | ||
/** | ||
* @template {string} T | ||
* @typedef {{ foo: T }} Foo | ||
*/ | ||
|
||
export default {}; | ||
>{} : {} | ||
|
||
=== tests/cases/compiler/file2.js === | ||
|
||
/** | ||
* @template T | ||
* @typedef {import('./file1').Foo<T>} Bar | ||
*/ | ||
|
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 @@ | ||
// @noEmit: true | ||
// @filename: file1.ts | ||
export type Foo<T extends string> = { foo: T } | ||
|
||
// @noEmit: true | ||
// @filename: file2.ts | ||
type Bar<T> = import('./file1').Foo<T>; |
19 changes: 19 additions & 0 deletions
19
tests/cases/compiler/unmetTypeConstraintInJSDocImportCall.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,19 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @noEmit: true | ||
// @filename: file1.js | ||
/** | ||
* @template {string} T | ||
* @typedef {{ foo: T }} Foo | ||
*/ | ||
|
||
export default {}; | ||
|
||
// @allowJs: true | ||
// @checkJs: true | ||
// @noEmit: true | ||
// @filename: file2.js | ||
/** | ||
* @template T | ||
* @typedef {import('./file1').Foo<T>} Bar | ||
*/ |