Skip to content

Conversation

sinsoku
Copy link
Contributor

@sinsoku sinsoku commented Sep 15, 2025

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

Co-Authored-By: Claude [email protected]

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 <[email protected]>
@sinsoku sinsoku force-pushed the fix-NoMethodError-in-SigTyIntersectionNode branch from f148e3d to 2cfaa79 Compare September 15, 2025 06:02
@sinsoku sinsoku changed the title Fix NoMethodError in SigTyIntersectionNode typecheck method Fix NoMethodError in SigTyIntersectionNode when using intersection types Sep 15, 2025
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 this pull request may close these issues.

1 participant