You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update type-only import semantics to allow type queries (#36092)
* Change type-only semantics to allow type queries
* Don’t error using type-only import in ambient context
* Fix default import
* Fix namespace import
* Update more baselines
* Prevent circular resolution
* Track const enum expression usage
* Update baselines
* Perf tuning 1
* Test commit for perf impact
* Weave type-only alias declaration finding into alias resolution
* Fix namespace import of type-only exported symbols
* type-only exports do not contribute to the module object type
* Update APIs
* Fix enum casing, remove type-only conversion suggestion
* Short circuit type-only checks in resolveEntityName faster
* Fix casing in API
* Remove unused parameter
* Fix error on qualified names in type queries
* Allow type-only imports in computed property names
* Fix computed property names of types and abstract members
* Remove unused util
* Commit missing baselines
* Rename “check” functions so as not to overload the word “check”
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+15-7
Original file line number
Diff line number
Diff line change
@@ -1055,11 +1055,15 @@
1055
1055
"category": "Error",
1056
1056
"code": 1359
1057
1057
},
1058
-
"Type-only {0} must reference a type, but '{1}' is a value.": {
1058
+
"Did you mean to parenthesize this function type?": {
1059
+
"category": "Error",
1060
+
"code": 1360
1061
+
},
1062
+
"'{0}' cannot be used as a value because it was imported using 'import type'.": {
1059
1063
"category": "Error",
1060
1064
"code": 1361
1061
1065
},
1062
-
"Enum '{0}' cannot be used as a value because only its type has been imported.": {
1066
+
"'{0}' cannot be used as a value because it was exported using 'export type'.": {
1063
1067
"category": "Error",
1064
1068
"code": 1362
1065
1069
},
@@ -1099,10 +1103,6 @@
1099
1103
"category": "Error",
1100
1104
"code": 1371
1101
1105
},
1102
-
"This import may be converted to a type-only import.": {
1103
-
"category": "Suggestion",
1104
-
"code": 1372
1105
-
},
1106
1106
"Convert to type-only import": {
1107
1107
"category": "Message",
1108
1108
"code": 1373
@@ -1115,9 +1115,17 @@
1115
1115
"category": "Error",
1116
1116
"code": 1375
1117
1117
},
1118
+
"'{0}' was imported here.": {
1119
+
"category": "Message",
1120
+
"code": 1376
1121
+
},
1122
+
"'{0}' was exported here.": {
1123
+
"category": "Message",
1124
+
"code": 1377
1125
+
},
1118
1126
"Top-level 'await' expressions are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher.": {
1119
1127
"category": "Error",
1120
-
"code": 1376
1128
+
"code": 1378
1121
1129
},
1122
1130
"The types of '{0}' are incompatible between these types.": {
* This is either an `export =` or an `export default` declaration.
@@ -4062,7 +4063,8 @@ namespace ts {
4062
4063
instantiations?: Map<Type>;// Instantiations of generic type alias (undefined if non-generic)
4063
4064
inferredClassSymbol?: Map<TransientSymbol>;// Symbol of an inferred ES5 constructor function
4064
4065
mapper?: TypeMapper;// Type mapper for instantiation alias
4065
-
referenced?: boolean;// True if alias symbol has been referenced as a value
4066
+
referenced?: boolean;// True if alias symbol has been referenced as a value that can be emitted
4067
+
constEnumReferenced?: boolean;// True if alias symbol resolves to a const enum and is referenced as a value ('referenced' will be false)
4066
4068
containingType?: UnionOrIntersectionType;// Containing union or intersection type for synthetic property
4067
4069
leftSpread?: Symbol;// Left source for synthetic spread property
4068
4070
rightSpread?: Symbol;// Right source for synthetic spread property
@@ -4085,6 +4087,7 @@ namespace ts {
4085
4087
deferralConstituents?: Type[];// Calculated list of constituents for a deferred type
4086
4088
deferralParent?: Type;// Source union/intersection of a deferred type
4087
4089
cjsExportMerged?: Symbol;// Version of the symbol with all non export= exports merged with the export= target
4090
+
typeOnlyDeclaration?: TypeOnlyCompatibleAliasDeclaration|false;// First resolved alias declaration that makes the symbol only usable in type constructs
0 commit comments