Repository: soutaro/steep (Ruby)

Issue:
Unexpected error when or-asgn/and-asgn
issue.rbs

```rbs
class Issue
  def unexpected=: (Integer) -> Integer
end
```

issue.rb

```rb
class Issue
  def or_asgn
    self.unexpected ||= 1
  end
end
```

Steepfile

```rb
target :issue do
  check "issue.rb"
  signature "issue.rbs"

  configure_code_diagnostics(Steep::Diagnostic::Ruby.all_error)
end
```

`$ steep check`

```
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)] Unexpected error: #<NoMethodError: undefined method `type' for nil:NilClass

                 arguments.take_while {|node| node.type != :block_pass }
                                                  ^^^^^>
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_inference/send_args.rb:507:in `block in positional_arg'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_inference/send_args.rb:507:in `take_while'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_inference/send_args.rb:507:in `positional_arg'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_inference/send_args.rb:533:in `each'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3217:in `block in try_method_type'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/subtyping/check.rb:48:in `push_variable_bounds'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3213:in `try_method_type'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3080:in `block (3 levels) in type_method_call'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/typing.rb:231:in `new_child'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3079:in `block (2 levels) in type_method_call'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3078:in `block in type_method_call'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3077:in `map'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:3077:in `type_method_call'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:2864: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:867: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:856:in `block 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:758: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1834: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1817:in `block 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:758: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:2293: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:2267:in `block 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:758: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:2482:in `check'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1059:in `block (3 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:270:in `block in with_method_constr'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/subtyping/check.rb:48:in `push_variable_bounds'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:269:in `with_method_constr'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1037: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1034:in `block 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:758: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1527:in `block (3 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:541:in `block in with_class_constr'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/subtyping/check.rb:48:in `push_variable_bounds'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:540:in `with_class_constr'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1511: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:1497:in `block 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:758: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:777: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:762:in `block 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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/type_construction.rb:758: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:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/services/type_check_service.rb:385:in `type_check'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/services/type_check_service.rb:327:in `block in type_check_file'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/services/type_check_service.rb:325:in `type_check_file'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/services/type_check_service.rb:281:in `block (2 levels) in typecheck_source'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep.rb:166:in `measure'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/services/type_check_service.rb:275:in `block in typecheck_source'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/services/type_check_service.rb:274:in `typecheck_source'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/server/type_check_worker.rb:182:in `handle_job'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/server/base_worker.rb:54:in `block (2 levels) in run'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `block in tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:37:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/activesupport-7.0.2.3/lib/active_support/tagged_logging.rb:99:in `tagged'
[Steep 0.49.1] [typecheck:typecheck@0] [background] [#typecheck_source(path=sample.rb)] [#type_check_file(sample.rb@sample)] [synthesize:(1:1)] [synthesize:(70:1)] [synthesize:(71:3)] [synthesize:(72:5)] [synthesize:(72:5)] [synthesize:(72:5)]   /Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/steep-0.49.1/lib/steep/server/base_worker.rb:44:in `block in run'
```

steep: 0.49.1
ruby: 3.1.1


Discussion:

Patch:
diff --git a/lib/steep/type_construction.rb b/lib/steep/type_construction.rb
index 027e0c845..9c1b57f17 100644
--- a/lib/steep/type_construction.rb
+++ b/lib/steep/type_construction.rb
@@ -2275,13 +2275,10 @@ def synthesize(node, hint: nil, condition: false)
               type, constr = synthesize(rhs, hint: hint)
               constr.ivasgn(asgn, type)
             when :send
-              rhs_ = node.updated(:send,
-                                  [
-                                    asgn.children[0],
-                                    :"#{asgn.children[1]}=",
-                                    asgn.children[2],
-                                    rhs
-                                  ])
+              children = asgn.children.dup
+              children[1] = :"#{children[1]}="
+              send_arg_nodes = [*children, rhs]
+              rhs_ = node.updated(:send, send_arg_nodes)
               node_type = case node.type
                           when :or_asgn
                             :or


Test patch:
diff --git a/test/type_construction_test.rb b/test/type_construction_test.rb
index 499e25878..7e27a585d 100644
--- a/test/type_construction_test.rb
+++ b/test/type_construction_test.rb
@@ -2083,6 +2083,41 @@ def test_or_and_asgn
     end
   end
 
+  def test_or_and_asgn_method
+    with_checker(<<-RBS) do |checker|
+class OrAndAsgn
+  def or_asgn: () -> Integer
+  def and_asgn: () -> Integer
+  def var=: (Integer) -> Integer
+end
+RBS
+      source = parse_ruby(<<-'EOF')
+class OrAndAsgn
+  def or_asgn
+    self.var ||= 1
+  end
+
+  def and_asgn
+    self.var &&= 2
+  end
+
+  def var=(a)
+    a
+  end
+end
+EOF
+
+      with_standard_construction(checker, source) do |construction, typing|
+        construction.synthesize(source.node)
+        assert_equal 2, typing.errors.size
+        assert_all typing.errors do |error|
+          assert_equal :var, error.method
+          error.is_a?(Diagnostic::Ruby::NoMethod)
+        end
+      end
+    end
+  end
+
   def test_next
     with_checker do |checker|
       source = parse_ruby(<<-'EOF')