diff --git a/lib/typeprof/core/env/method.rb b/lib/typeprof/core/env/method.rb index 36798f8b..e14141a5 100644 --- a/lib/typeprof/core/env/method.rb +++ b/lib/typeprof/core/env/method.rb @@ -50,7 +50,7 @@ def get_rest_args(genv, start_rest, end_rest) a_arg.each_type do |ty| ty = ty.base_type(genv) if ty.is_a?(Type::Instance) && ty.mod == genv.mod_ary && ty.args[0] - vtxs << ty.args[0] + vtxs << ty.args[0].new_vertex(genv, self) else "???" end diff --git a/lib/typeprof/core/graph/vertex.rb b/lib/typeprof/core/graph/vertex.rb index e855c571..b841fbb2 100644 --- a/lib/typeprof/core/graph/vertex.rb +++ b/lib/typeprof/core/graph/vertex.rb @@ -141,6 +141,7 @@ def initialize(origin) when AST::Node when RBS::AST::Declarations::Base when ValueEntity + when ActualArguments else raise "unknown class: #{ origin.class }" end diff --git a/scenario/args/splat-twice.rb b/scenario/args/splat-twice.rb new file mode 100644 index 00000000..4e1ecf44 --- /dev/null +++ b/scenario/args/splat-twice.rb @@ -0,0 +1,18 @@ +## update +class Foo + def gen + [1] + end + + def check + ary = [] + ary.append(*gen) + ary.append(*gen) + end +end + +## assert +class Foo + def gen: -> [Integer] + def check: -> Array[Integer] +end