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 6c353bb
Browse filesBrowse the repository at this point in the historyBrowse files
Compare runtime annotations and untagged payloads across signatures
Why:
Interface inclusion ignored `@instanceOf`/`@typeOf`. An interface could
claim a class its implementation does not have, or hide a private
superclass manifest; the implementation and its clients then compiled
different checks for the same values, and #8938 came back in the
clients. Functor arguments, `with type` constraints and module type
ascriptions had the same hole.
When an interface states a class or `typeof` for a type, through its own
annotation or the type it abbreviates, the implementation must state the same
one, superclasses included. An interface that states none hides it. The
payload kind of every untagged case is compared too, so a variant declared
in both is recognized the same way on both sides.
Diagnostic added (hidden superclass):
Example:
// Classes.res
@instanceof("Animal") type animal
@instanceof("Dog") type dog = private animal
// Classes.resi
@instanceof("Animal") type animal
@instanceof("Dog") type dog
After (diagnostic):
Type declarations do not match:
type dog = animal
is not included in
type dog
Their runtime representations differ:
the first declaration states instances of Dog, a subclass of Animal,
the second declaration states instances of Dog.
Diagnostic added (claim the implementation does not make):
Example:
// Claim.res
type t = option<string>
// Claim.resi
@typeof("string") type t
After (diagnostic):
Their runtime representations differ:
the first declaration states no runtime class or typeof,
the second declaration states values whose typeof is "string".
Review: Why compare payload kinds when the payload types are already
compared? Equal payload types are classified alike only when both sides see
the same annotations; an interface that hides one (stating none, which is
allowed) gives its variant another layout.
Review: Why not compare `@notUndefined` too? It is unchanged here and has the
same hole on master; the implied never-undefined of the new annotations is
covered, because the classification includes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fc7LEuyEfynjaKCVEBPmTF
Signed-off-by: Christoph Knittel <ck@cca.io>
0 commit comments