Skip to content
Merged
Changes from 1 commit
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 Jan 8, 2020
2ae9edc
Don’t error using type-only import in ambient context
andrewbranch Jan 8, 2020
db93eb2
Fix default import
andrewbranch Jan 8, 2020
a2548c8
Fix namespace import
andrewbranch Jan 8, 2020
8d3f167
Update more baselines
andrewbranch Jan 8, 2020
b56ad7d
Prevent circular resolution
andrewbranch Jan 8, 2020
0547a3d
Track const enum expression usage
andrewbranch Jan 9, 2020
124dcd6
Update baselines
andrewbranch Jan 9, 2020
2dd3690
Perf tuning 1
andrewbranch Jan 10, 2020
eefa335
Test commit for perf impact
andrewbranch Jan 10, 2020
9a24cba
Weave type-only alias declaration finding into alias resolution
andrewbranch Jan 13, 2020
875349d
Fix namespace import of type-only exported symbols
andrewbranch Jan 14, 2020
171e314
type-only exports do not contribute to the module object type
andrewbranch Jan 14, 2020
910dd84
Update APIs
andrewbranch Jan 14, 2020
2a7c472
Fix enum casing, remove type-only conversion suggestion
andrewbranch Jan 14, 2020
11ba11a
Short circuit type-only checks in resolveEntityName faster
andrewbranch Jan 14, 2020
0c28994
Fix casing in API
andrewbranch Jan 14, 2020
40a2c3c
Remove unused parameter
andrewbranch Jan 14, 2020
1cbfb81
Merge branch 'master' into type-only-2
andrewbranch Jan 14, 2020
124d746
Fix error on qualified names in type queries
andrewbranch Jan 14, 2020
bbbcbd5
Merge branch 'master' into type-only-2
andrewbranch Jan 15, 2020
1044c5c
Allow type-only imports in computed property names
andrewbranch Jan 15, 2020
a5ca492
Fix computed property names of types and abstract members
andrewbranch Jan 16, 2020
8571a8a
Remove unused util
andrewbranch Jan 16, 2020
8b4c235
Commit missing baselines
andrewbranch Jan 16, 2020
be5f50f
Merge branch master into type-only-2
andrewbranch Jan 21, 2020
19b3206
Rename “check” functions so as not to overload the word “check”
andrewbranch Jan 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Perf tuning 1
  • Loading branch information
andrewbranch committed Jan 10, 2020
commit 2dd3690c25edee0a82de3a62137ab05f5d9ca87c
22 changes: 10 additions & 12 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2476,22 +2476,20 @@ namespace ts {

/** Indicates that a symbol directly or indirectly resolves to a type-only import or export. */
function getTypeOnlyAliasDeclaration(symbol: Symbol): Identifier | ImportSpecifier | ExportSpecifier | undefined {
if (!(symbol.flags & SymbolFlags.Alias)) {
return undefined;
}
const links = getSymbolLinks(symbol);
if (links.typeOnlyDeclaration === undefined) {
if (symbol.flags & SymbolFlags.Alias) {
const node = getDeclarationOfAliasSymbol(symbol);
if (!node) return Debug.fail();
if (isTypeOnlyImportOrExportName(node)) {
links.typeOnlyDeclaration = node;
}
else {
const alias = getImmediateAliasedSymbol(symbol);
links.typeOnlyDeclaration = false; // Prevents circular resolution possible in error scenarios
links.typeOnlyDeclaration = !!alias && getTypeOnlyAliasDeclaration(alias);
}
const node = getDeclarationOfAliasSymbol(symbol);
if (!node) return Debug.fail();
if (isTypeOnlyImportOrExportName(node)) {
links.typeOnlyDeclaration = node;
}
else {
links.typeOnlyDeclaration = false;
const alias = getImmediateAliasedSymbol(symbol);
links.typeOnlyDeclaration = false; // Prevents circular resolution possible in error scenarios
links.typeOnlyDeclaration = !!alias && getTypeOnlyAliasDeclaration(alias);
}
}
return links.typeOnlyDeclaration || undefined;
Expand Down