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

Unexpected error when super with block #512

Closed
ksss opened this issue Mar 14, 2022 · 0 comments · Fixed by #568
Closed

Unexpected error when super with block #512

ksss opened this issue Mar 14, 2022 · 0 comments · Fixed by #568

Comments

@ksss
Copy link
Contributor

ksss commented Mar 14, 2022

test.rbs

class TestSuper
  def foo: () -> Integer
  def bar: () { (Integer) -> void } -> Integer
end

class TestSuperChild < TestSuper
  def foo: () -> Integer
  def bar: () { (Integer) -> void } -> Integer
end

test.rb

class TestSuperChild
  def foo
    super + 3 #=> ok
    super() + 1 #=> ok
  end

  def bar
    super {} + 1 #=> Unexpected error
    super() {} + 2 #=> Unexpected error
  end
end
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)] Unexpected error: #<NoMethodError: undefined method `selector' for #<Parser::Source::Map::Keyword:0x0000000107efee00 @keyword=#<Parser::Source::Range sample.rb 116...121>, @end=nil, @begin=nil, @expression=#<Parser::Source::Range sample.rb 116...121>, @node=s(:zsuper)>

                  node.children[0].loc.selector
                                      ^^^^^^^^^>
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/diagnostic/ruby.rb:248:in `initialize'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:2937:in `new'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:2937:in `type_send_interface'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3027:in `type_send'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1010:in `block (2 levels) in synthesize'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   <internal:kernel>:148:in `yield_self'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(9:3)] [synthesize:(10:5)] [synthesize:(10:5)] [synthesize:(10:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1005:in `block in synthesize'

steep version: 0.49.1
ruby version: 3.1.1

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

Successfully merging a pull request may close this issue.

1 participant