Open
Description
attr_reader foo: untyped
in RBS defines the signature for the method#foo
as woulddef foo: () -> untyped
- with
Steep::Diagnostic::Ruby::MethodDefinitionMissing
Steep expects the method#foo
from the above attr_reader
in Ruby defines the method#foo
yet Steep can't find it, even though both.rb
and .rbsuse
attr_reader` semantics
Expected result:
attr_reader foo: untyped
should be able to findattr_reader
-defined methods- Arguably
def foo: () -> untyped
+@foo: untyped
should also work with and findattr_reader :foo
- Same for
attr_writer
andattr_accessor
and#foo=
Actual result:
# foo.rb
class Foo
attr_reader :foo
end
# foo.rbs
class Foo
attr_reader foo: untyped
end
# Steepfile
target :lib do
configure_code_diagnostics do |hash|
hash[Steep::Diagnostic::Ruby::MethodDefinitionMissing] = :error
end
check '.'
signature '.'
end
$ bundle exec steep check foo.rb
foo.rb:1:6: [error] Cannot find implementation of method `::Foo#foo`
│ Diagnostic ID: Ruby::MethodDefinitionMissing
│
└ class Foo
Metadata
Metadata
Assignees
Labels
No labels