steep icon indicating copy to clipboard operation
steep copied to clipboard

Ruby::UnexpectedError when a method receives a kwarg as a record type

Open pocke opened this issue 4 years ago • 1 comments

Ruby::UnexpectedError occurs when a method receives a kwarg as a record type. Steep version is v0.46.0.

# Steepfile
target :lib do
  check '.'
  signature '.'
end
# test.rbs
class C
  def self.m1: ({a: String}) -> void
  def self.m2: (a: String) -> void
  def self.m3: (Hash[Symbol, String]) -> void
end
# test.rb
C.m1(a: 'str')     # error
C.m1({a: 'str'})   # ok
C.m2(a: 'str')     # ok
# C.m2({a: 'str'}) # Type error (expected)
C.m3(a: 'str')     # ok
C.m3({a: 'str'})   # ok
$ steep check
# Type checking files:

..............................[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)] Unexpected error: RuntimeError
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:3801:in `type_hash_record'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:3851:in `block in type_hash'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2975:in `with_child_typing'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:3850:in `type_hash'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:1388:in `block in synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:683:in `synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2401:in `check'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:3367:in `type_check_argument'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:3013:in `block in try_method_type'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_inference/send_args.rb:546:in `block in each'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   <internal:kernel>:90:in `tap'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_inference/send_args.rb:544:in `each'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:3010:in `try_method_type'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2918:in `block (3 levels) in type_method_call'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/typing.rb:231:in `new_child'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2917:in `block (2 levels) in type_method_call'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2916:in `block in type_method_call'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2915:in `map'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2915:in `type_method_call'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2729:in `type_send_interface'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:2878:in `type_send'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:792:in `block (2 levels) in synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   <internal:kernel>:148:in `yield_self'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:781:in `block in synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:683:in `synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:693:in `block (3 levels) in synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:692:in `each'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:692:in `inject'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:692:in `block (2 levels) in synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   <internal:kernel>:148:in `yield_self'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:687:in `block in synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/type_construction.rb:683:in `synthesize'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/services/type_check_service.rb:382:in `type_check'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/services/type_check_service.rb:325:in `block in type_check_file'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/services/type_check_service.rb:323:in `type_check_file'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/services/type_check_service.rb:279:in `block (2 levels) in typecheck_source'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep.rb:166:in `measure'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/services/type_check_service.rb:273:in `block in typecheck_source'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/services/type_check_service.rb:272:in `typecheck_source'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/server/type_check_worker.rb:182:in `handle_job'
.[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/server/base_worker.rb:53:in `block (2 levels) in run'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/activesupport-6.1.4.1/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.46.0] [typecheck:typecheck@1] [background] [#typecheck_source(path=test.rb)] [#type_check_file(test.rb@lib)] [synthesize:(1:1)] [synthesize:(1:1)] [({ :a => ::String }) -> void] [synthesize:(1:6)]   /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/3.1.0/gems/steep-0.46.0/lib/steep/server/base_worker.rb:43:in `block in run'
..F...........................

test.rb:1:5: [error] UnexpectedError:
│ Diagnostic ID: Ruby::UnexpectedError
│
└ C.m1(a: 'str')     # error
       ~~~~~~~~

Detected 1 problem from 1 file

I actually found the problem on ruby/gem_rbs_collection repository. The RBS for retryable gem has the same problem. ref: https://github.com/ruby/gem_rbs_collection/pull/58

pocke avatar Sep 05 '21 13:09 pocke

Maybe resolved. https://github.com/soutaro/steep/pull/444

ksss avatar Nov 15 '21 05:11 ksss