Skip to content

Commit 6c2c70f

Browse files
committed
fix(lint): read the refused field's type from the field-type index, not off the field
The #5017 receiver meta-test pins the keys the field walk reads off its receiver; the type is already in the index the walk builds. Claude-Session: https://claude.ai/code/session_019oFY6Hi35J7atvgVFnmoaK Co-authored-by: Claude <noreply@anthropic.com>
1 parent 37aa1d6 commit 6c2c70f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎packages/lint/src/validate-expressions.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,14 +2886,20 @@ export function runStackExpressionPasses(stack: AnyRec, options: StackExpression
28862886
// still refused by the pass that owned that verdict first. NOT fenced on
28872887
// an object write: the field is the object's own body, so the object save
28882888
// door gives the build's verdict, at the build's position in this walk.
2889+
// The type is read from the field-type index, never off the field again:
2890+
// the #5017 receiver meta-test pins the keys this walk reads off `f`. The
2891+
// collector admits only a field whose `type` is a string, and the index
2892+
// records every such field, so each collected field has its type here.
28892893
if (objectName) {
28902894
const familyRefs = storedMetadataBodyReferencesFor(objectName);
2891-
for (const [fname, f] of fieldList) {
2895+
const ownFieldTypes = fieldTypeIndex.get(objectName);
2896+
for (const [fname] of fieldList) {
28922897
const target = familyRefs.get(fname);
2893-
if (!target) continue;
2898+
const type = ownFieldTypes?.[fname];
2899+
if (!target || !type) continue;
28942900
issues.push({
28952901
where: `object '${objectName}' · field '${fname}' reference`,
2896-
message: storedMetadataBodyReferenceMessage(fname, String(f.type), target),
2902+
message: storedMetadataBodyReferenceMessage(fname, type, target),
28972903
source: '',
28982904
severity: 'error',
28992905
});

0 commit comments

Comments
 (0)