'RBS::Types::Proc#map_type_name': undefined method 'map_type_name' for an instance of RBS::Types::UntypedFunction (NoMethodError)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with lib/rbs/types.rb around RBS::Types::Proc#map_type_name, then follow the stack through lib/rbs/environment.rb and the validate entry point. Reproduce the issue with rbs -Isig validate using the sample signature. Done means the documented untyped-parameter Proc syntax validates without raising NoMethodError.
Written by the indexing model from the issue text.
Description
Hey, not sure if this is meant to be valid or not, but while trying to write various tests I came across this sample which errors on rbs -Isig validate:
class Foo
def t: -> (^(?) -> void)
end
I believe it's valid syntax (from the docs), but correct me if I'm wrong on that.
_proc_ ::= `^` _parameters?_ _self-type-binding?_ _block?_ `->` _type_
| `^` `(` `?` `)` `->` _type_ # Proc type with untyped parameter
I'm using Ruby 3.4.0-preview2, and RBS 3.6.1.
The stack trace is:
/Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/types.rb:1428:in 'RBS::Types::Proc#map_type_name': undefined method 'map_type_name' for an instance of RBS::Types::UntypedFunction (NoMethodError)
type: type.map_type_name(&block),
^^^^^^^^^^^^^^
Did you mean? map_type
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:793:in 'RBS::Environment#absolute_type'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:775:in 'block in RBS::Environment#resolve_method_type'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/types.rb:1002:in 'RBS::Types::Function#map_type'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/method_type.rb:66:in 'RBS::MethodType#map_type'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:774:in 'RBS::Environment#resolve_method_type'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:681:in 'block in RBS::Environment#resolve_member'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:679:in 'Array#map'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:679:in 'RBS::Environment#resolve_member'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:570:in 'block in RBS::Environment#resolve_declaration'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:567:in 'Array#map'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:567:in 'RBS::Environment#resolve_declaration'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:512:in 'block (2 levels) in RBS::Environment#resolve_type_names'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:508:in 'Array#map'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:508:in 'block in RBS::Environment#resolve_type_names'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:500:in 'Hash#each'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/environment.rb:500:in 'RBS::Environment#resolve_type_names'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/cli/validate.rb:53:in 'RBS::CLI::Validate#initialize'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/cli.rb:447:in 'Class#new'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/cli.rb:447:in 'RBS::CLI#run_validate'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/lib/rbs/cli.rb:140:in 'RBS::CLI#run'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/rbs-3.6.1/exe/rbs:7:in '<top (required)>'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/bin/rbs:25:in 'Kernel#load'
from /Users/hjwylde/.asdf/installs/ruby/3.4.0-preview2/bin/rbs:25:in '<main>'
- Dominant language
- Ruby
- Stars
- 2.2k
- Forks
- 263
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 64
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/rbs
-
InlineParser: `@rbs @ivar` annotation is reported as unused unless it is the first thing in the class bodyPossibly taken @ksss claimed this 50 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Maintainers usually reply within 1 day
Similar issues
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
betagouv/conseillers-entreprises#4808 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yosiat/panko_serializer#250 ·