Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/semantic/type-annotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,17 @@ class TypeAnnotator {
}
return;
}
// Member access on a class/interface-typed object. Only cache when the
// resolved type is itself class/interface (avoids disagreeing with
// symbol-table-allocated storage for primitives/arrays/Map/Set).
// Issue #658 gate-loosen step 2.
if (e.type === "member_access") {
const resolved = this.sink.resolveExpressionTypeRich(expr);
if (resolved && this.isSafeVariableAnnotationType(resolved)) {
this.sink.appendExpressionType(expr, resolved);
}
return;
}
// let/const decl bindings and interface-typed params are intentionally
// skipped. Decl bindings can be refined mid-codegen (JSON.parse target
// type, await result specialization); caching the declared type would
Expand Down
Loading