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
Explain unresolvable and impossible types with reasons
IsSuperTypeOfResult already carries reasons; this propagates them from the
type layer all the way into rule errors as tips.
- NeverType/ErrorType gain an optional reason. ConstantArrayType explains
why two sealed array shapes cannot be intersected; the reason flows
through TypeCombinator::intersect() and a new UnresolvableTypeResult
returned by UnresolvableTypeHelper, so every "contains unresolvable type"
rule can show it.
- ObjectType/ObjectShapeType::isSuperTypeOf() now explain non-obvious no()
results: a trait used as a type, two unrelated classes (single
inheritance), a final class that does not implement an interface, and
inaccessible object-shape properties.
- ImpossibleInstanceofRule and the ImpossibleCheckType{Function,Method,
StaticMethod}CallRule family surface these reasons via acceptsReasonsTip();
several existing rules (strict comparison, intersection typehints, etc.)
pick them up automatically.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments