Skip to content

Commit 9ba02ec

Browse files
committed
Fix NoMethodError in SigTyTupleNode#typecheck for instance types
`SigTyTupleNode#typecheck` was passing wrong parameter (ty instead of vtx) to `f_ty.typecheck` when handling `Type::Instance` objects, causing: "undefined method `each_type' for an instance of TypeProf::Core::Type::Instance". ``` /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/sig_type.rb:5:in `typecheck_for_module': undefined method `each_type' for an instance of TypeProf::Core::Type::Instance (NoMethodError) a_vtx.each_type do |ty| ^^^^^^^^^^ from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/sig_type.rb:669:in `typecheck' from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/sig_type.rb:727:in `block (2 levels) in typecheck' from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/sig_type.rb:726:in `each' from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/core/ast/sig_type.rb:726:in `block in typecheck' ```
1 parent 5d26f86 commit 9ba02ec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/typeprof/core/ast/sig_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ def typecheck(genv, changes, vtx, subst)
711711
return true
712712
when Type::Instance
713713
@types.each do |f_ty|
714-
return false unless f_ty.typecheck(genv, changes, ty, subst)
714+
return false unless f_ty.typecheck(genv, changes, vtx, subst)
715715
end
716716
return true
717717
end

0 commit comments

Comments
 (0)