Commit 2cfaa79
Fix NoMethodError in SigTyIntersectionNode when using intersection types
When I tried TypeProf in VSCode, I got the following error:
```
/Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/sig_type.rb:503:in `typecheck': undefined method `each' for nil (NoMethodError)
@types.each do |type|
^^^^^
from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/graph/box.rb:152:in `block in match_arguments?'
from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/graph/box.rb:151:in `each'
```
This is because the SigTyIntersectionNode class does not have an initialize method, and the `@types` instance is not initialized.
This commit fixes it.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5d26f86 commit 2cfaa79
2 files changed
Lines changed: 55 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
494 | 503 | | |
495 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
496 | 507 | | |
497 | 508 | | |
498 | 509 | | |
499 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
500 | 513 | | |
501 | 514 | | |
502 | 515 | | |
| |||
507 | 520 | | |
508 | 521 | | |
509 | 522 | | |
510 | | - | |
| 523 | + | |
511 | 524 | | |
512 | 525 | | |
513 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments