Report a property whose type is a contract the document cannot declare - #2530
Conversation
A type reference is written as a single identifier, and what is reported is a type the document then refers to without ever declaring it. That was recognised only where the name itself lost something - a constructed generic or a type parameter - so an interface or an abstract class, whose name survives intact, matched neither branch and was emitted with no diagnostic at all. The declaration is what cannot be written for those: a type says what a value holds, and a contract leaves that to whatever implements it. Only a record is declared, so the property names something the document never introduces, which is the same dangling reference and is now said the same way. An abstract record is excluded - it is declared like any other record. What the document contains is unchanged; this only stops the silence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Covers an interface and an abstract class being reported, and an abstract record not being - the line between a type no declaration is written for and a type something can merely derive from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Reviewer context. This is part 1 only of #2527 — what an unnameable property should emit is a Screenplay language question and is deliberately untouched. The change. The boundary, and why there is a spec for it. Being abstract is not on its own the trigger. Verified against Studio. Generated from
The four new ones are The 27 document warnings do not move, and that is the point. The two generated documents are byte-identical — diffed, not assumed. Part 1 changes what is reported and nothing about what is written, so the invalid document stays exactly as invalid until part 2 is decided. Why Verification. |
Fixed
SP0030for a property whose type is an interface or an abstract class. The document names such a type without ever declaring it, and until now nothing said so — only a constructed generic or a type parameter was recognised, and a contract matched neither. (A property whose type cannot be named is still emitted, and for an interface or abstract class nothing reports it #2527)