Skip to content

Commit c1a8439

Browse files
committed
actually fix it fix it
1 parent db429aa commit c1a8439

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/compiler/checker.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11366,18 +11366,25 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1136611366
if (!isThisProperty(node) || !isAutoTypedProperty(prop)) {
1136711367
return false;
1136811368
}
11369-
const autoContainer = getAutoContainer(node);
11369+
const autoContainer = getAutoContainer(node)!;
1137011370
return isClassStaticBlockDeclaration(autoContainer) && (prop.parent && getClassLikeDeclarationOfSymbol(prop.parent)) === autoContainer.parent;
1137111371
}
1137211372
if (!isConstructorDeclaredProperty(prop) && (!isThisProperty(node) || !isAutoTypedProperty(prop))) {
1137311373
return false;
1137411374
}
11375-
const autoContainer = getAutoContainer(node);
11375+
const autoContainer = getAutoContainer(node)!;
1137611376
return isConstructorDeclaration(autoContainer) && (prop.parent && getClassLikeDeclarationOfSymbol(prop.parent)) === autoContainer.parent || autoContainer === getDeclaringConstructor(prop);
1137711377
}
1137811378

1137911379
function getAutoContainer(node: Node) {
11380-
return findAncestor(node.parent, node => !!getContainingFunctionOrClassStaticBlock(node) && !getImmediatelyInvokedFunctionExpression(node))!;
11380+
let container = getContainingFunctionOrClassStaticBlock(node);
11381+
while (container) {
11382+
if (getImmediatelyInvokedFunctionExpression(container)) {
11383+
container = getContainingFunctionOrClassStaticBlock(container);
11384+
continue;
11385+
}
11386+
return container;
11387+
}
1138111388
}
1138211389

1138311390
function getDeclaringConstructor(symbol: Symbol) {

0 commit comments

Comments
 (0)