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

Yielding untyped to multiple parameters should assume that all parameters are untyped #778

Closed
mame opened this issue May 19, 2023 · 0 comments · Fixed by #798
Closed

Yielding untyped to multiple parameters should assume that all parameters are untyped #778

mame opened this issue May 19, 2023 · 0 comments · Fixed by #798
Labels
area/core Issues related to the type checker core enhancement
Milestone

Comments

@mame
Copy link
Contributor

mame commented May 19, 2023

Consider the following t.rbs and t.rb:

t.rbs

class Object
  def foo: (Array[untyped]) -> void
end

t.rb

def foo(ary_of_untyped)
  ary_of_untyped.each do |x, y|
    y.bar
  end
end

Here is the result of steep check

t.rb:3:6: [error] Type `nil` does not have method `bar`
│ Diagnostic ID: Ruby::NoMethod
│
└     y.bar
        ~~~

I expect no error to be displayed because I think y should be untyped, not nil.

@soutaro soutaro added this to the Steep 1.5 milestone May 19, 2023
@soutaro soutaro moved this to 🔖 Ready in Steep and RBS May 23, 2023
@soutaro soutaro added the area/core Issues related to the type checker core label May 23, 2023
@github-project-automation github-project-automation bot moved this from 🔖 Ready to ✅ Done in Steep and RBS May 24, 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 enhancement
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants