File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -10205,15 +10205,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
10205
10205
const isOptional = includeOptionality && isOptionalDeclaration(declaration);
10206
10206
10207
10207
// Use type from type annotation if one is present
10208
- let declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
10208
+ const declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
10209
10209
if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
10210
10210
if (declaredType) {
10211
10211
// If the catch clause is explicitly annotated with any or unknown, accept it, otherwise error.
10212
10212
return isTypeAny(declaredType) || declaredType === unknownType ? declaredType : errorType;
10213
10213
}
10214
10214
// If the catch clause is not explicitly annotated, treat it as though it were explicitly
10215
10215
// annotated with unknown or any, depending on useUnknownInCatchVariables.
10216
- declaredType = useUnknownInCatchVariables ? unknownType : anyType;
10216
+ return useUnknownInCatchVariables ? unknownType : anyType;
10217
10217
}
10218
10218
if (declaredType) {
10219
10219
return addOptionality(declaredType, isProperty, isOptional);
You can’t perform that action at this time.
0 commit comments