You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d06f82d
Browse filesBrowse the repository at this point in the historyBrowse files
Store the resolved runtime shape on type declarations
Why:
Every reader re-derived what `@instanceOf`, `@typeOf` and `@notUndefined`
state by walking a type's expansion chain in the reader's environment.
Interface inclusion therefore evaluated an interface's
`@instanceOf("Dog") type dog = private animal` against the
implementation's annotated `animal`, while clients saw an unannotated
`animal`: a superclass hidden that way was lost in clients.
A declaration now carries `type_shape`: `Unstated`, `Never_undefined`, or
`Recognized_as` a class with its superclasses or a `typeof` kind, resolved
when the type is declared, in the environment it is declared in. The
classifier, `option` unboxing and inclusion read it, walking only to the
first declaration that states a shape; no attribute is parsed after
declaration, and the deduplication of annotations repeated through module
aliases is gone.
Diagnostic added (a superclass hidden by its interface):
Example:
// Classes.res
@instanceof("Animal") type animal
@instanceof("Dog") type dog = private animal
// Classes.resi
type animal
@instanceof("Dog") type dog = private animal
After (diagnostic):
Their runtime representations differ:
the first declaration states instances of Dog, a subclass of Animal,
the second declaration states instances of Dog.
Review: Why a field rather than a normalized attribute? The facts are typed
data, not text, and a field cannot be printed or forwarded by tools that
handle attributes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMkrYaktctdKc4M41WF36t
Signed-off-by: Christoph Knittel <ck@cca.io>
# Conflicts:
# compiler/ext/config.ml
0 commit comments