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
The #ivar_name attribute of each RBS::Members::Attribute* class can return one of 3 things:
# ivar_name will return `nil`, which indicates the default (@a) is inferredattr_readera: Integer# ivar_name will return `:something_else`attr_readerb(@something_else): String# ivar_name will return `false`attr_readerc(): bool
This has a few downsides:
The distinction between nil and false is subtle and non-obvious
Most callers (e.g. a type checker, LSP, etc.) probably care about the instance variable name regardless of whether it was inferred or explicit, and will have to compute it themselves when they get nil.
This will also makes the C API less clear, since the type has to be some general node type (e.g. rbs_node_t *), rather than specifically a symbol type (rbs_symbol_t * or NULL).
I propose we deprecate this field, and come up with an easier-to-consume alternative.
The text was updated successfully, but these errors were encountered:
The
#ivar_name
attribute of eachRBS::Members::Attribute*
class can return one of 3 things:This has a few downsides:
The distinction between
nil
andfalse
is subtle and non-obviousMost callers (e.g. a type checker, LSP, etc.) probably care about the instance variable name regardless of whether it was inferred or explicit, and will have to compute it themselves when they get
nil
.The RBS type of this field is complex:
rbs/sig/members.rbs
Line 177 in 3fc6b05
rbs_node_t *
), rather than specifically a symbol type (rbs_symbol_t *
orNULL
).I propose we deprecate this field, and come up with an easier-to-consume alternative.
The text was updated successfully, but these errors were encountered: