Skip to content

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

@mame

Description

@mame

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions