Closed HoneyryderChuck closed 3 weeks ago
Did you mean? Steep still consider b to be String?
, not String
I’ve reproduced in Steep 1.7 but it is able to type-narrow using the if
statement with or without %a{pure}
.
OTOH, Steep does not type narrow without the if
statement by inferring from #initialize
I get Cannot find implementation of method `::A#b`
somehow, but it does not impact the topic.
Aren’t attr_XXX
be pure by definition?
unless they’re used by lazy people to write RBS for their custom accessors
you're correct, it's already pure. I got confused by the message.
I see that the
%a{pure}
label can be added todef
to indicate the return value of a function is pure (which helps in type narrowing), but the same does not seem to work for attribute readers: