Open lloeki opened 5 months ago
Attempted a fix in https://github.com/soutaro/steep/pull/1037, probably not a very good one.
Apparently the solution (as of 1.6.0) is to use @dynamic
:
# foo.rb
class Foo
# @dynamic foo
attr_reader :foo
end
Which feels very redundant given that RBS's attr_reader
already knows that.
attr_reader foo: untyped
in RBS defines the signature for the method#foo
as woulddef foo: () -> untyped
Steep::Diagnostic::Ruby::MethodDefinitionMissing
Steep expects the method#foo
from the aboveattr_reader
in Ruby defines the method#foo
yet Steep can't find it, even though both.rb
and .rbsuse
attr_reader` semanticsExpected result:
attr_reader foo: untyped
should be able to findattr_reader
-defined methodsdef foo: () -> untyped
+@foo: untyped
should also work with and findattr_reader :foo
attr_writer
andattr_accessor
and#foo=
Actual result: