Skip to content

Commit e872af5

Browse files
committed
Return errorType when resolving binding element contextual type falls in a loop
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent 86a543b commit e872af5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11642,7 +11642,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1164211642
// const { a, b = a } = { a: 0 }
1164311643
//
1164411644
if (isBindingElement(declaration) && checkMode === CheckMode.Contextual) {
11645-
return anyType;
11645+
return errorType;
1164611646
}
1164711647
return reportCircularityError(symbol);
1164811648
}

0 commit comments

Comments
 (0)