mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-15 22:15:05 -05:00
Set parent pointers on manufactured reference for property initialization check (#27246)
This commit is contained in:
committed by
Wesley Wigham
parent
9103191527
commit
93f6b73c8c
@@ -26176,6 +26176,8 @@ namespace ts {
|
||||
|
||||
function isPropertyInitializedInConstructor(propName: Identifier, propType: Type, constructor: ConstructorDeclaration) {
|
||||
const reference = createPropertyAccess(createThis(), propName);
|
||||
reference.expression.parent = reference;
|
||||
reference.parent = constructor;
|
||||
reference.flowNode = constructor.returnFlowNode;
|
||||
const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
||||
return !(getFalsyFlags(flowType) & TypeFlags.Undefined);
|
||||
|
||||
Reference in New Issue
Block a user