-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Update type-only import semantics to allow type queries #36092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b40284c
Change type-only semantics to allow type queries
andrewbranch 2ae9edc
Don’t error using type-only import in ambient context
andrewbranch db93eb2
Fix default import
andrewbranch a2548c8
Fix namespace import
andrewbranch 8d3f167
Update more baselines
andrewbranch b56ad7d
Prevent circular resolution
andrewbranch 0547a3d
Track const enum expression usage
andrewbranch 124dcd6
Update baselines
andrewbranch 2dd3690
Perf tuning 1
andrewbranch eefa335
Test commit for perf impact
andrewbranch 9a24cba
Weave type-only alias declaration finding into alias resolution
andrewbranch 875349d
Fix namespace import of type-only exported symbols
andrewbranch 171e314
type-only exports do not contribute to the module object type
andrewbranch 910dd84
Update APIs
andrewbranch 2a7c472
Fix enum casing, remove type-only conversion suggestion
andrewbranch 11ba11a
Short circuit type-only checks in resolveEntityName faster
andrewbranch 0c28994
Fix casing in API
andrewbranch 40a2c3c
Remove unused parameter
andrewbranch 1cbfb81
Merge branch 'master' into type-only-2
andrewbranch 124d746
Fix error on qualified names in type queries
andrewbranch bbbcbd5
Merge branch 'master' into type-only-2
andrewbranch 1044c5c
Allow type-only imports in computed property names
andrewbranch a5ca492
Fix computed property names of types and abstract members
andrewbranch 8571a8a
Remove unused util
andrewbranch 8b4c235
Commit missing baselines
andrewbranch be5f50f
Merge branch master into type-only-2
andrewbranch 19b3206
Rename “check” functions so as not to overload the word “check”
andrewbranch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,25 @@ | ||
//// [tests/cases/conformance/externalModules/typeOnly/ambient.ts] //// | ||
|
||
//// [a.ts] | ||
export class A { a!: string } | ||
|
||
//// [b.ts] | ||
import type { A } from './a'; | ||
declare class B extends A {} | ||
declare namespace ns { | ||
class C extends A {} | ||
} | ||
|
||
|
||
//// [a.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var A = /** @class */ (function () { | ||
function A() { | ||
} | ||
return A; | ||
}()); | ||
exports.A = A; | ||
//// [b.js] | ||
"use strict"; | ||
exports.__esModule = true; |
This file contains hidden or 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 @@ | ||
=== /a.ts === | ||
export class A { a!: string } | ||
>A : Symbol(A, Decl(a.ts, 0, 0)) | ||
>a : Symbol(A.a, Decl(a.ts, 0, 16)) | ||
|
||
=== /b.ts === | ||
import type { A } from './a'; | ||
>A : Symbol(A, Decl(b.ts, 0, 13)) | ||
|
||
declare class B extends A {} | ||
>B : Symbol(B, Decl(b.ts, 0, 29)) | ||
>A : Symbol(A, Decl(b.ts, 0, 13)) | ||
|
||
declare namespace ns { | ||
>ns : Symbol(ns, Decl(b.ts, 1, 28)) | ||
|
||
class C extends A {} | ||
>C : Symbol(C, Decl(b.ts, 2, 22)) | ||
>A : Symbol(A, Decl(b.ts, 0, 13)) | ||
} | ||
|
This file contains hidden or 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 @@ | ||
=== /a.ts === | ||
export class A { a!: string } | ||
>A : A | ||
>a : string | ||
|
||
=== /b.ts === | ||
import type { A } from './a'; | ||
>A : A | ||
|
||
declare class B extends A {} | ||
>B : B | ||
>A : A | ||
|
||
declare namespace ns { | ||
>ns : typeof ns | ||
|
||
class C extends A {} | ||
>C : C | ||
>A : A | ||
} | ||
|
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.