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
Prioritize RBS ivar declarations over inferred types on read
When an instance variable has an RBS type declaration, IVarReadBox now
returns the declared type instead of the union of all assigned types.
This prevents nil pollution from base-class initializations like
@x = nil from leaking into subclass reads that have declarations.
To make this work regardless of file load order, IVarReadBox subscribes
to every ive it visits via add_depended_value_entity, and ValueEntity
re-runs those subscribers from on_decl_changed when a declaration is
added or removed by SigInstanceVariableNode. Without this, an RBS file
loaded after the corresponding Ruby file would leave stale edges from
the inferred path in the type graph.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments