Skip to content

Commit a450bda

Browse files
Update LKG
1 parent 13b6193 commit a450bda

File tree

3 files changed

+42
-36
lines changed

3 files changed

+42
-36
lines changed

lib/tsc.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -42806,7 +42806,11 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
4280642806
if (modulePath.isRedirect) {
4280742807
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
4280842808
} else if (pathIsBareSpecifier(local)) {
42809-
pathsSpecifiers = append(pathsSpecifiers, local);
42809+
if (pathContainsNodeModules(local)) {
42810+
relativeSpecifiers = append(relativeSpecifiers, local);
42811+
} else {
42812+
pathsSpecifiers = append(pathsSpecifiers, local);
42813+
}
4281042814
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
4281142815
relativeSpecifiers = append(relativeSpecifiers, local);
4281242816
}
@@ -76090,19 +76094,16 @@ function createTypeChecker(host) {
7609076094
}
7609176095
}
7609276096
}
76093-
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
76097+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
7609476098
const signature = getSingleCallSignature(funcType);
76095-
if (signature) {
76096-
const returnType = getReturnTypeOfSignature(signature);
76097-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
76098-
return returnType;
76099-
}
76099+
if (signature && !signature.typeParameters) {
76100+
return getReturnTypeOfSignature(signature);
7610076101
}
7610176102
}
7610276103
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
7610376104
const funcType = checkExpression(expr.expression);
7610476105
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
76105-
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
76106+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
7610676107
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
7610776108
}
7610876109
function getTypeOfExpression(node) {
@@ -76147,7 +76148,7 @@ function createTypeChecker(host) {
7614776148
/*requireStringLiteralLikeArgument*/
7614876149
true
7614976150
) && !isSymbolOrSymbolForCall(expr)) {
76150-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
76151+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
7615176152
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
7615276153
return getTypeFromTypeNode(expr.type);
7615376154
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
@@ -81502,14 +81503,15 @@ function createTypeChecker(host) {
8150281503
idText(id)
8150381504
);
8150481505
}
81505-
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
81506-
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
81506+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
81507+
const nonLocalMeanings = getSymbolFlags(
8150781508
sym,
8150881509
/*excludeTypeOnlyMeanings*/
8150981510
false,
8151081511
/*excludeLocalMeanings*/
8151181512
true
81512-
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
81513+
);
81514+
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
8151381515
error(
8151481516
id,
8151581517
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,

lib/tsserver.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -47541,7 +47541,11 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
4754147541
if (modulePath.isRedirect) {
4754247542
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
4754347543
} else if (pathIsBareSpecifier(local)) {
47544-
pathsSpecifiers = append(pathsSpecifiers, local);
47544+
if (pathContainsNodeModules(local)) {
47545+
relativeSpecifiers = append(relativeSpecifiers, local);
47546+
} else {
47547+
pathsSpecifiers = append(pathsSpecifiers, local);
47548+
}
4754547549
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
4754647550
relativeSpecifiers = append(relativeSpecifiers, local);
4754747551
}
@@ -80825,19 +80829,16 @@ function createTypeChecker(host) {
8082580829
}
8082680830
}
8082780831
}
80828-
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
80832+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
8082980833
const signature = getSingleCallSignature(funcType);
80830-
if (signature) {
80831-
const returnType = getReturnTypeOfSignature(signature);
80832-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
80833-
return returnType;
80834-
}
80834+
if (signature && !signature.typeParameters) {
80835+
return getReturnTypeOfSignature(signature);
8083580836
}
8083680837
}
8083780838
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
8083880839
const funcType = checkExpression(expr.expression);
8083980840
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
80840-
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
80841+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
8084180842
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
8084280843
}
8084380844
function getTypeOfExpression(node) {
@@ -80882,7 +80883,7 @@ function createTypeChecker(host) {
8088280883
/*requireStringLiteralLikeArgument*/
8088380884
true
8088480885
) && !isSymbolOrSymbolForCall(expr)) {
80885-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
80886+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
8088680887
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
8088780888
return getTypeFromTypeNode(expr.type);
8088880889
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
@@ -86237,14 +86238,15 @@ function createTypeChecker(host) {
8623786238
idText(id)
8623886239
);
8623986240
}
86240-
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
86241-
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
86241+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
86242+
const nonLocalMeanings = getSymbolFlags(
8624286243
sym,
8624386244
/*excludeTypeOnlyMeanings*/
8624486245
false,
8624586246
/*excludeLocalMeanings*/
8624686247
true
86247-
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
86248+
);
86249+
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
8624886250
error2(
8624986251
id,
8625086252
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,

lib/typescript.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -45394,7 +45394,11 @@ ${lanes.join("\n")}
4539445394
if (modulePath.isRedirect) {
4539545395
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
4539645396
} else if (pathIsBareSpecifier(local)) {
45397-
pathsSpecifiers = append(pathsSpecifiers, local);
45397+
if (pathContainsNodeModules(local)) {
45398+
relativeSpecifiers = append(relativeSpecifiers, local);
45399+
} else {
45400+
pathsSpecifiers = append(pathsSpecifiers, local);
45401+
}
4539845402
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
4539945403
relativeSpecifiers = append(relativeSpecifiers, local);
4540045404
}
@@ -78579,19 +78583,16 @@ ${lanes.join("\n")}
7857978583
}
7858078584
}
7858178585
}
78582-
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
78586+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
7858378587
const signature = getSingleCallSignature(funcType);
78584-
if (signature) {
78585-
const returnType = getReturnTypeOfSignature(signature);
78586-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
78587-
return returnType;
78588-
}
78588+
if (signature && !signature.typeParameters) {
78589+
return getReturnTypeOfSignature(signature);
7858978590
}
7859078591
}
7859178592
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
7859278593
const funcType = checkExpression(expr.expression);
7859378594
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
78594-
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
78595+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
7859578596
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
7859678597
}
7859778598
function getTypeOfExpression(node) {
@@ -78636,7 +78637,7 @@ ${lanes.join("\n")}
7863678637
/*requireStringLiteralLikeArgument*/
7863778638
true
7863878639
) && !isSymbolOrSymbolForCall(expr)) {
78639-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
78640+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
7864078641
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
7864178642
return getTypeFromTypeNode(expr.type);
7864278643
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
@@ -83991,14 +83992,15 @@ ${lanes.join("\n")}
8399183992
idText(id)
8399283993
);
8399383994
}
83994-
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
83995-
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
83995+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
83996+
const nonLocalMeanings = getSymbolFlags(
8399683997
sym,
8399783998
/*excludeTypeOnlyMeanings*/
8399883999
false,
8399984000
/*excludeLocalMeanings*/
8400084001
true
84001-
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
84002+
);
84003+
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
8400284004
error2(
8400384005
id,
8400484006
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,

0 commit comments

Comments
 (0)