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

lambda's parameter is marked as untyped with union #666

Closed
pocke opened this issue Oct 31, 2022 · 0 comments · Fixed by #807
Closed

lambda's parameter is marked as untyped with union #666

pocke opened this issue Oct 31, 2022 · 0 comments · Fixed by #807
Labels
area/core Issues related to the type checker core bug
Milestone

Comments

@pocke
Copy link
Contributor

pocke commented Oct 31, 2022

Lambda's parameter is marked as untyped unexpectedly when the lambda is assigned to a variable as a union type.

# It is ok. `str` is `String`
# @type var x: ^(String) -> void
x = -> (str) { str + 'a' }

# It is not ok. `str` is `untyped`, but I expected `String`.
# @type var x: ^(String) -> void | nil
x = -> (str) { str + 'a' }

I've confirmed this problem with vscode and Steep LSP's hover feature.
Screen Shot 2022-11-01 at 0 34 41


Actually I found this problem when I tried to enable checking "untyped call" on retryable gem's RBS.
https://github.com/ruby/gem_rbs_collection/blob/006177988c5ad5261efe67af814cc0f726b0eb8e/gems/retryable/3.0/configuration.rbs#L23
https://github.com/ruby/gem_rbs_collection/blob/006177988c5ad5261efe67af814cc0f726b0eb8e/gems/retryable/3.0/_test/test.rb#L68
In this case, retries is marked as untyped unexpectedly.

@soutaro soutaro added the bug label May 17, 2023
@soutaro soutaro added this to the Steep 1.5 milestone May 17, 2023
@soutaro soutaro added the area/core Issues related to the type checker core label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues related to the type checker core bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants