Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining Proc with untyped parameter raises NoMethodError on RBS::Types::UntypedFunction #1233

Open
Coridyn opened this issue Sep 26, 2024 · 1 comment

Comments

@Coridyn
Copy link

Coridyn commented Sep 26, 2024

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

  1. Define this proc in an .rbs file:
# rbs
type untyped_proc = ^(?) -> void
  1. Run steep check
  2. 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
@tk0miya
Copy link
Contributor

tk0miya commented Oct 7, 2024

I think this is a bug of the RBS gem. So I posted ruby/rbs#2054 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants