steep
steep copied to clipboard
Defining Proc with untyped parameter raises NoMethodError on RBS::Types::UntypedFunction
Issue Steep raises an error when it encounters the definition for a "proc with an untyped parameter"
Running Ruby 3.3.0 and Steep 1.7.1
Steps to reproduce
- Define this proc in an
.rbsfile:
# rbs
type untyped_proc = ^(?) -> void
- Run
steep check - Steep will raise this error
[Steep 1.7.1] [typecheck:typecheck@10] [background] Unexpected error: #<NoMethodError: undefined method `map_type_name' for an instance of RBS::Types::UntypedFunction>
(see attached proc-with-untyped-parameter-error.txt file for full stacktrace)
I think this definition of a proc is correct, as shown in the current RBS syntax document:
_proc_ ::= `^` _parameters?_ _self-type-binding?_ _block?_ `->` _type_
| `^` `(` `?` `)` `->` _type_ # Proc type with untyped parameter
I think this is a bug of the RBS gem. So I posted ruby/rbs#2054 to fix this.