Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
typescript-bot committed Jan 25, 2024
1 parent 13b6193 commit a450bda
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 36 deletions.
26 changes: 14 additions & 12 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42806,7 +42806,11 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
if (modulePath.isRedirect) {
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
} else if (pathIsBareSpecifier(local)) {
pathsSpecifiers = append(pathsSpecifiers, local);
if (pathContainsNodeModules(local)) {
relativeSpecifiers = append(relativeSpecifiers, local);
} else {
pathsSpecifiers = append(pathsSpecifiers, local);
}
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
relativeSpecifiers = append(relativeSpecifiers, local);
}
Expand Down Expand Up @@ -76090,19 +76094,16 @@ function createTypeChecker(host) {
}
}
}
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
const signature = getSingleCallSignature(funcType);
if (signature) {
const returnType = getReturnTypeOfSignature(signature);
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
return returnType;
}
if (signature && !signature.typeParameters) {
return getReturnTypeOfSignature(signature);
}
}
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
const funcType = checkExpression(expr.expression);
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
}
function getTypeOfExpression(node) {
Expand Down Expand Up @@ -76147,7 +76148,7 @@ function createTypeChecker(host) {
/*requireStringLiteralLikeArgument*/
true
) && !isSymbolOrSymbolForCall(expr)) {
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
return getTypeFromTypeNode(expr.type);
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
Expand Down Expand Up @@ -81502,14 +81503,15 @@ function createTypeChecker(host) {
idText(id)
);
}
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
const nonLocalMeanings = getSymbolFlags(
sym,
/*excludeTypeOnlyMeanings*/
false,
/*excludeLocalMeanings*/
true
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
);
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
error(
id,
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,
Expand Down
26 changes: 14 additions & 12 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -47541,7 +47541,11 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
if (modulePath.isRedirect) {
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
} else if (pathIsBareSpecifier(local)) {
pathsSpecifiers = append(pathsSpecifiers, local);
if (pathContainsNodeModules(local)) {
relativeSpecifiers = append(relativeSpecifiers, local);
} else {
pathsSpecifiers = append(pathsSpecifiers, local);
}
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
relativeSpecifiers = append(relativeSpecifiers, local);
}
Expand Down Expand Up @@ -80825,19 +80829,16 @@ function createTypeChecker(host) {
}
}
}
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
const signature = getSingleCallSignature(funcType);
if (signature) {
const returnType = getReturnTypeOfSignature(signature);
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
return returnType;
}
if (signature && !signature.typeParameters) {
return getReturnTypeOfSignature(signature);
}
}
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
const funcType = checkExpression(expr.expression);
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
}
function getTypeOfExpression(node) {
Expand Down Expand Up @@ -80882,7 +80883,7 @@ function createTypeChecker(host) {
/*requireStringLiteralLikeArgument*/
true
) && !isSymbolOrSymbolForCall(expr)) {
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
return getTypeFromTypeNode(expr.type);
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
Expand Down Expand Up @@ -86237,14 +86238,15 @@ function createTypeChecker(host) {
idText(id)
);
}
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
const nonLocalMeanings = getSymbolFlags(
sym,
/*excludeTypeOnlyMeanings*/
false,
/*excludeLocalMeanings*/
true
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
);
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
error2(
id,
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,
Expand Down
26 changes: 14 additions & 12 deletions lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -45394,7 +45394,11 @@ ${lanes.join("\n")}
if (modulePath.isRedirect) {
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
} else if (pathIsBareSpecifier(local)) {
pathsSpecifiers = append(pathsSpecifiers, local);
if (pathContainsNodeModules(local)) {
relativeSpecifiers = append(relativeSpecifiers, local);
} else {
pathsSpecifiers = append(pathsSpecifiers, local);
}
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
relativeSpecifiers = append(relativeSpecifiers, local);
}
Expand Down Expand Up @@ -78579,19 +78583,16 @@ ${lanes.join("\n")}
}
}
}
function getNonGenericReturnTypeOfSingleCallSignature(funcType) {
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
const signature = getSingleCallSignature(funcType);
if (signature) {
const returnType = getReturnTypeOfSignature(signature);
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
return returnType;
}
if (signature && !signature.typeParameters) {
return getReturnTypeOfSignature(signature);
}
}
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
const funcType = checkExpression(expr.expression);
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
const returnType = getNonGenericReturnTypeOfSingleCallSignature(funcType);
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
}
function getTypeOfExpression(node) {
Expand Down Expand Up @@ -78636,7 +78637,7 @@ ${lanes.join("\n")}
/*requireStringLiteralLikeArgument*/
true
) && !isSymbolOrSymbolForCall(expr)) {
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getNonGenericReturnTypeOfSingleCallSignature(checkNonNullExpression(expr.expression));
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
return getTypeFromTypeNode(expr.type);
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
Expand Down Expand Up @@ -83991,14 +83992,15 @@ ${lanes.join("\n")}
idText(id)
);
}
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
const nonLocalMeanings = getSymbolFlags(
sym,
/*excludeTypeOnlyMeanings*/
false,
/*excludeLocalMeanings*/
true
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
);
if (sym.flags & 2097152 /* Alias */ && nonLocalMeanings & 788968 /* Type */ && !(nonLocalMeanings & 111551 /* Value */) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
error2(
id,
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,
Expand Down

0 comments on commit a450bda

Please sign in to comment.