Skip to content

Error: Unexpected node: s(:restarg, _args@1) #7

@denisdefreyne

Description

@denisdefreyne

steep check can raise #<RuntimeError: Unexpected node: s(:restarg, _args@1), 2> when using splat args.

Steps to reproduce

Create a file called x.rb:

class Hi
  def method_missing(*_args)
    self
  end
end

Run steep check x.rb:

#<RuntimeError: Unexpected node: s(:restarg, _args@1), 2>
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:598:in `synthesize'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:301:in `block in synthesize'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:737:in `block in each_child_node'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:735:in `each'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:735:in `each_child_node'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:300:in `synthesize'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:443:in `block in synthesize'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:442:in `tap'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/type_construction.rb:442:in `synthesize'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/drivers/check.rb:65:in `block in run'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/drivers/check.rb:44:in `each'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/drivers/check.rb:44:in `run'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/cli.rb:76:in `process_check'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/lib/steep/cli.rb:41:in `run'
  /usr/local/lib/ruby/gems/2.4.0/gems/steep-0.1.0.pre/exe/steep:11:in `<top (required)>'
  /usr/local/bin/steep:23:in `load'
  /usr/local/bin/steep:23:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions