diff --git a/lib/typeprof/core/graph/vertex.rb b/lib/typeprof/core/graph/vertex.rb index e2fa29ba..c0e726e7 100644 --- a/lib/typeprof/core/graph/vertex.rb +++ b/lib/typeprof/core/graph/vertex.rb @@ -23,7 +23,7 @@ def each_type(&blk) def check_match(genv, changes, vtx) vtx.each_type do |ty| if ty.is_a?(Type::Var) - changes.add_edge(genv, self, ty.vtx) + changes.add_edge(genv, self, ty.vtx) if self != ty.vtx return true end end diff --git a/scenario/regressions/self-type-var.rb b/scenario/regressions/self-type-var.rb new file mode 100644 index 00000000..7c3e44c3 --- /dev/null +++ b/scenario/regressions/self-type-var.rb @@ -0,0 +1,6 @@ +## update: test.rb +def check2 + @ary = [].to_a + @ary = @ary.concat(@ary) + @ary = @ary.concat(@ary) +end