|
|
@@ -629,7 +629,15 @@ class Walker {
|
|
|
};
|
|
|
}
|
|
|
if (stripped.kind === 'record') {
|
|
|
- this.issue(nm, `Record "${stripped.name ?? '?'}" has no field "${nm.text}"`);
|
|
|
+ // Report only when the field list is knowable: a nominal record
|
|
|
+ // name, or an inline RECORD declaration on the host symbol.
|
|
|
+ // Anything else (e.g. a type from a sibling or unavailable
|
|
|
+ // definition module) stays silent per the zero-false-positive
|
|
|
+ // rule — hence never `Record "?" ...`.
|
|
|
+ if (stripped.name || /RECORD/i.test(decl.sym.detail)) {
|
|
|
+ const what = stripped.name ? `Record "${stripped.name}"` : 'Record';
|
|
|
+ this.issue(nm, `${what} has no field "${nm.text}"`);
|
|
|
+ }
|
|
|
return { type: UNKNOWN, decl: null };
|
|
|
}
|
|
|
if (stripped.kind !== 'unknown') {
|
|
|
@@ -649,8 +657,8 @@ class Walker {
|
|
|
this.issue(nm, `Type ${displayType(stripped)} is not a record`);
|
|
|
return { type: UNKNOWN, decl: null };
|
|
|
}
|
|
|
- if (stripped.kind === 'record') {
|
|
|
- this.issue(nm, `Record "${stripped.name ?? '?'}" has no field "${nm.text}"`);
|
|
|
+ if (stripped.kind === 'record' && stripped.name) {
|
|
|
+ this.issue(nm, `Record "${stripped.name}" has no field "${nm.text}"`);
|
|
|
}
|
|
|
return { type: UNKNOWN, decl: null };
|
|
|
}
|