typeprof 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -2
- data/lib/typeprof/analyzer.rb +82 -59
- data/lib/typeprof/block.rb +34 -0
- data/lib/typeprof/builtin.rb +169 -64
- data/lib/typeprof/cli.rb +2 -0
- data/lib/typeprof/config.rb +13 -1
- data/lib/typeprof/export.rb +114 -69
- data/lib/typeprof/import.rb +50 -28
- data/lib/typeprof/iseq.rb +23 -4
- data/lib/typeprof/method.rb +29 -7
- data/lib/typeprof/type.rb +41 -13
- data/lib/typeprof/version.rb +1 -1
- data/smoke/alias.rb +4 -4
- data/smoke/alias2.rb +3 -1
- data/smoke/arguments.rb +2 -2
- data/smoke/arguments2.rb +5 -5
- data/smoke/array-each.rb +1 -1
- data/smoke/array-each3.rb +1 -1
- data/smoke/array-map.rb +1 -1
- data/smoke/array-map2.rb +1 -1
- data/smoke/array-map3.rb +3 -3
- data/smoke/array-mul.rb +2 -2
- data/smoke/array-plus1.rb +1 -1
- data/smoke/array-plus2.rb +1 -0
- data/smoke/array-range-aref.rb +11 -11
- data/smoke/array-replace.rb +1 -1
- data/smoke/array1.rb +5 -5
- data/smoke/array10.rb +1 -1
- data/smoke/array11.rb +1 -1
- data/smoke/array12.rb +1 -1
- data/smoke/array14.rb +1 -1
- data/smoke/array15.rb +1 -1
- data/smoke/array2.rb +2 -2
- data/smoke/array3.rb +1 -0
- data/smoke/array6.rb +2 -1
- data/smoke/array8.rb +1 -1
- data/smoke/array9.rb +1 -1
- data/smoke/attr-module.rb +1 -0
- data/smoke/attr-vis.rb +43 -0
- data/smoke/attr-vis.rbs +4 -0
- data/smoke/attr.rb +2 -2
- data/smoke/block-ambiguous.rb +4 -4
- data/smoke/block-args1-rest.rb +6 -5
- data/smoke/block-args1.rb +5 -5
- data/smoke/block-args2-rest.rb +6 -5
- data/smoke/block-args2.rb +5 -5
- data/smoke/block-args3-rest.rb +7 -6
- data/smoke/block-args3.rb +6 -6
- data/smoke/block-blockarg.rb +3 -3
- data/smoke/block-kwarg.rb +4 -4
- data/smoke/block1.rb +1 -1
- data/smoke/block10.rb +1 -1
- data/smoke/block11.rb +2 -2
- data/smoke/block2.rb +1 -1
- data/smoke/block3.rb +1 -1
- data/smoke/block5.rb +1 -0
- data/smoke/block_given.rb +37 -0
- data/smoke/class_method.rb +2 -2
- data/smoke/class_method2.rb +2 -2
- data/smoke/constant2.rb +3 -2
- data/smoke/context-sensitive1.rb +1 -1
- data/smoke/cvar.rb +3 -2
- data/smoke/define_method.rb +2 -2
- data/smoke/define_method3.rb +1 -0
- data/smoke/define_method4.rb +1 -1
- data/smoke/define_method6.rb +19 -0
- data/smoke/demo.rb +6 -6
- data/smoke/demo1.rb +1 -1
- data/smoke/demo11.rb +1 -1
- data/smoke/demo2.rb +1 -1
- data/smoke/demo3.rb +1 -1
- data/smoke/demo4.rb +3 -3
- data/smoke/demo5.rb +1 -1
- data/smoke/demo6.rb +2 -1
- data/smoke/demo7.rb +1 -1
- data/smoke/demo9.rb +1 -0
- data/smoke/dummy-execution1.rb +1 -1
- data/smoke/dummy-execution2.rb +1 -1
- data/smoke/dummy_element.rb +1 -1
- data/smoke/ensure1.rb +1 -1
- data/smoke/enum_for.rb +15 -0
- data/smoke/enum_for2.rb +17 -0
- data/smoke/fib.rb +2 -2
- data/smoke/flow1.rb +1 -1
- data/smoke/flow10.rb +17 -0
- data/smoke/flow2.rb +1 -1
- data/smoke/flow3.rb +1 -1
- data/smoke/flow5.rb +1 -1
- data/smoke/flow6.rb +1 -1
- data/smoke/flow7.rb +1 -1
- data/smoke/flow8.rb +1 -1
- data/smoke/flow9.rb +1 -1
- data/smoke/function.rb +1 -1
- data/smoke/gvar.rb +1 -1
- data/smoke/gvar2.rb +1 -1
- data/smoke/hash-fetch.rb +3 -3
- data/smoke/inheritance.rb +4 -4
- data/smoke/initialize.rb +3 -2
- data/smoke/instance_eval.rb +1 -1
- data/smoke/int_times.rb +1 -1
- data/smoke/integer.rb +1 -1
- data/smoke/ivar.rb +3 -2
- data/smoke/ivar2.rb +2 -2
- data/smoke/ivar3.rb +2 -1
- data/smoke/ivar4.rb +1 -0
- data/smoke/kernel-class.rb +1 -1
- data/smoke/keyword4.rb +1 -1
- data/smoke/kwrest.rb +1 -0
- data/smoke/kwsplat1.rb +2 -2
- data/smoke/kwsplat2.rb +1 -1
- data/smoke/manual-rbs.rb +1 -0
- data/smoke/manual-rbs3.rb +1 -0
- data/smoke/method_missing.rb +4 -3
- data/smoke/module3.rb +1 -1
- data/smoke/module4.rb +1 -0
- data/smoke/module5.rb +1 -1
- data/smoke/module_function1.rb +3 -2
- data/smoke/module_function2.rb +3 -2
- data/smoke/multiple-include.rb +1 -0
- data/smoke/next1.rb +1 -1
- data/smoke/object-send1.rb +3 -3
- data/smoke/optional1.rb +1 -1
- data/smoke/optional2.rb +1 -1
- data/smoke/optional3.rb +1 -1
- data/smoke/parameterizedd-self.rb +2 -1
- data/smoke/prepend1.rb +33 -0
- data/smoke/prepend2.rb +10 -0
- data/smoke/prepend2.rbs +9 -0
- data/smoke/primitive_method.rb +19 -0
- data/smoke/proc4.rb +1 -1
- data/smoke/public.rb +4 -0
- data/smoke/range.rb +1 -1
- data/smoke/rbs-attr.rb +2 -2
- data/smoke/rbs-proc2.rb +1 -1
- data/smoke/rbs-proc3.rb +1 -1
- data/smoke/rbs-tyvar4.rb +3 -2
- data/smoke/rbs-tyvar6.rb +3 -3
- data/smoke/redo1.rb +1 -1
- data/smoke/redo2.rb +1 -1
- data/smoke/rescue1.rb +1 -1
- data/smoke/rescue2.rb +1 -1
- data/smoke/rescue3.rb +1 -0
- data/smoke/rescue4.rb +1 -1
- data/smoke/respond_to.rb +1 -1
- data/smoke/rest1.rb +2 -2
- data/smoke/rest2.rb +1 -1
- data/smoke/rest3.rb +6 -6
- data/smoke/rest4.rb +2 -2
- data/smoke/rest5.rb +1 -1
- data/smoke/rest6.rb +1 -1
- data/smoke/retry1.rb +2 -2
- data/smoke/simple.rb +1 -1
- data/smoke/step.rb +3 -3
- data/smoke/struct-keyword_init.rb +5 -15
- data/smoke/struct5.rb +1 -1
- data/smoke/struct6.rb +1 -1
- data/smoke/super1.rb +4 -4
- data/smoke/super3.rb +3 -2
- data/smoke/super4.rb +7 -5
- data/smoke/super5.rb +6 -4
- data/smoke/symbol-proc-attr.rb +1 -1
- data/smoke/tap1.rb +2 -2
- data/smoke/toplevel.rb +1 -1
- data/smoke/type_var.rb +3 -3
- data/smoke/user-demo.rb +1 -1
- data/smoke/wrong-extend.rb +1 -0
- data/smoke/wrong-include.rb +1 -0
- data/smoke/wrong-include2.rb +1 -1
- metadata +14 -3
data/lib/typeprof/iseq.rb
CHANGED
@@ -207,7 +207,7 @@ module TypeProf
|
|
207
207
|
end
|
208
208
|
|
209
209
|
# find a pattern: getlocal, ..., send (is_a?, respond_to?), branch
|
210
|
-
|
210
|
+
getlocal_send_branch_list = []
|
211
211
|
(@insns.size - 1).times do |i|
|
212
212
|
insn, operands = @insns[i]
|
213
213
|
if insn == :getlocal && operands[1] == 0
|
@@ -216,7 +216,7 @@ module TypeProf
|
|
216
216
|
while @insns[j]
|
217
217
|
sp = check_send_branch(sp, j)
|
218
218
|
if sp == :match
|
219
|
-
|
219
|
+
getlocal_send_branch_list << [i, j]
|
220
220
|
break
|
221
221
|
end
|
222
222
|
break if !sp
|
@@ -224,13 +224,32 @@ module TypeProf
|
|
224
224
|
end
|
225
225
|
end
|
226
226
|
end
|
227
|
-
|
227
|
+
getlocal_send_branch_list.each do |i, j|
|
228
228
|
next if (i + 1 .. j + 1).any? {|i| branch_targets[i] }
|
229
229
|
_insn, getlocal_operands = @insns[i]
|
230
230
|
_insn, send_operands = @insns[j]
|
231
231
|
_insn, branch_operands = @insns[j + 1]
|
232
232
|
@insns[j] = [:nop]
|
233
|
-
@insns[j + 1] = [:
|
233
|
+
@insns[j + 1] = [:getlocal_send_branch, [getlocal_operands, send_operands, branch_operands]]
|
234
|
+
end
|
235
|
+
|
236
|
+
# find a pattern: send (block_given?), branch
|
237
|
+
send_branch_list = []
|
238
|
+
(@insns.size - 1).times do |i|
|
239
|
+
insn, _operands = @insns[i]
|
240
|
+
if insn == :send
|
241
|
+
insn, _operands = @insns[i + 1]
|
242
|
+
if insn == :branch
|
243
|
+
send_branch_list << i
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
send_branch_list.each do |i|
|
248
|
+
next if branch_targets[i + 1]
|
249
|
+
_insn, send_operands = @insns[i]
|
250
|
+
_insn, branch_operands = @insns[i + 1]
|
251
|
+
@insns[i] = [:nop]
|
252
|
+
@insns[i + 1] = [:send_branch, [send_operands, branch_operands]]
|
234
253
|
end
|
235
254
|
|
236
255
|
# find a pattern: getlocal, dup, branch
|
data/lib/typeprof/method.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module TypeProf
|
2
2
|
class MethodDef
|
3
|
+
attr_accessor :pub_meth
|
4
|
+
|
3
5
|
include Utils::StructuralEquality
|
4
6
|
end
|
5
7
|
|
@@ -12,8 +14,6 @@ module TypeProf
|
|
12
14
|
@pub_meth = pub_meth
|
13
15
|
end
|
14
16
|
|
15
|
-
attr_accessor :pub_meth
|
16
|
-
|
17
17
|
def do_send(recv, mid, aargs, caller_ep, caller_env, scratch, &ctn)
|
18
18
|
recv = recv.base_type while recv.respond_to?(:base_type)
|
19
19
|
recv = scratch.globalize_type(recv, caller_env, caller_ep)
|
@@ -153,14 +153,34 @@ module TypeProf
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
|
+
class AliasMethodDef < MethodDef
|
157
|
+
def initialize(orig_mid, mdef, def_ep)
|
158
|
+
@orig_mid = orig_mid
|
159
|
+
@mdef = mdef
|
160
|
+
@pub_meth = mdef.pub_meth
|
161
|
+
@def_ep = def_ep
|
162
|
+
end
|
163
|
+
|
164
|
+
attr_reader :orig_mid, :mdef, :def_ep
|
165
|
+
|
166
|
+
def do_send(recv, _mid, aargs, caller_ep, caller_env, scratch, &ctn)
|
167
|
+
@mdef.do_send(recv, @orig_mid, aargs, caller_ep, caller_env, scratch, &ctn)
|
168
|
+
end
|
169
|
+
|
170
|
+
def do_check_send(msig, recv, mid, ep, scratch)
|
171
|
+
@mdef.do_check_send(msig, recv, mid, ep, scratch)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
156
175
|
class AttrMethodDef < MethodDef
|
157
|
-
def initialize(ivar, kind,
|
176
|
+
def initialize(ivar, kind, pub_meth, def_ep)
|
158
177
|
@ivar = ivar
|
159
178
|
@kind = kind # :reader | :writer
|
160
|
-
@
|
179
|
+
@pub_meth = pub_meth
|
180
|
+
@def_ep = def_ep
|
161
181
|
end
|
162
182
|
|
163
|
-
attr_reader :ivar, :kind, :
|
183
|
+
attr_reader :ivar, :kind, :def_ep
|
164
184
|
|
165
185
|
def do_send(recv, mid, aargs, caller_ep, caller_env, scratch, &ctn)
|
166
186
|
case @kind
|
@@ -185,9 +205,10 @@ module TypeProf
|
|
185
205
|
end
|
186
206
|
|
187
207
|
class TypedMethodDef < MethodDef
|
188
|
-
def initialize(sig_rets, rbs_source) # sig_rets: Array<[MethodSignature, (return)Type]>
|
208
|
+
def initialize(sig_rets, rbs_source, pub_meth) # sig_rets: Array<[MethodSignature, (return)Type]>
|
189
209
|
@sig_rets = sig_rets
|
190
210
|
@rbs_source = rbs_source
|
211
|
+
@pub_meth = pub_meth
|
191
212
|
end
|
192
213
|
|
193
214
|
attr_reader :rbs_source
|
@@ -286,8 +307,9 @@ module TypeProf
|
|
286
307
|
end
|
287
308
|
|
288
309
|
class CustomMethodDef < MethodDef
|
289
|
-
def initialize(impl)
|
310
|
+
def initialize(impl, pub_meth)
|
290
311
|
@impl = impl
|
312
|
+
@pub_meth = pub_meth
|
291
313
|
end
|
292
314
|
|
293
315
|
def do_send(recv, mid, aargs, caller_ep, caller_env, scratch, &ctn)
|
data/lib/typeprof/type.rb
CHANGED
@@ -781,31 +781,56 @@ module TypeProf
|
|
781
781
|
class Signature
|
782
782
|
include Utils::StructuralEquality
|
783
783
|
|
784
|
-
def screen_name(scratch)
|
785
|
-
|
784
|
+
def screen_name(iseq, scratch)
|
785
|
+
fargs = @lead_tys.map {|ty| ty.screen_name(scratch) }
|
786
|
+
farg_names = []
|
787
|
+
farg_names += iseq.locals[0, @lead_tys.size] if iseq
|
786
788
|
if @opt_tys
|
787
|
-
|
789
|
+
fargs += @opt_tys.map {|ty| "?" + ty.screen_name(scratch) }
|
790
|
+
farg_names += iseq.locals[@lead_tys.size, @opt_tys.size] if iseq
|
788
791
|
end
|
789
792
|
if @rest_ty
|
790
|
-
|
793
|
+
fargs << ("*" + @rest_ty.screen_name(scratch))
|
794
|
+
if iseq
|
795
|
+
rest_index = iseq.fargs_format[:rest_start]
|
796
|
+
farg_names << (rest_index ? iseq.locals[rest_index] : nil)
|
797
|
+
end
|
791
798
|
end
|
792
799
|
if @post_tys
|
793
|
-
|
800
|
+
fargs += @post_tys.map {|ty| ty.screen_name(scratch) }
|
801
|
+
if iseq
|
802
|
+
post_start = iseq.fargs_format[:post_start]
|
803
|
+
farg_names += (post_start ? iseq.locals[post_start, @post_tys.size] : [nil] * @post_tys.size)
|
804
|
+
end
|
794
805
|
end
|
795
806
|
if @kw_tys
|
796
807
|
@kw_tys.each do |req, sym, ty|
|
797
808
|
opt = req ? "" : "?"
|
798
|
-
|
809
|
+
fargs << "#{ opt }#{ sym }: #{ ty.screen_name(scratch) }"
|
799
810
|
end
|
800
811
|
end
|
801
812
|
if @kw_rest_ty
|
802
|
-
|
813
|
+
all_val_ty = Type.bot
|
814
|
+
@kw_rest_ty.each_child_global do |ty|
|
815
|
+
if ty == Type.any
|
816
|
+
val_ty = ty
|
817
|
+
else
|
818
|
+
# ty is a Type::Hash
|
819
|
+
_key_ty, val_ty = ty.elems.squash
|
820
|
+
end
|
821
|
+
all_val_ty = all_val_ty.union(val_ty)
|
822
|
+
end
|
823
|
+
fargs << ("**" + all_val_ty.screen_name(scratch))
|
824
|
+
end
|
825
|
+
if Config.options[:show_parameter_names]
|
826
|
+
farg_names = farg_names.map {|name| name == :type ? :type_ : name } # XXX: workaround of RBS parser bug
|
827
|
+
fargs = fargs.zip(farg_names).map {|farg, name| name ? "#{ farg } #{ name }" : farg }
|
803
828
|
end
|
804
|
-
|
829
|
+
fargs = fargs.empty? ? "" : "(#{ fargs.join(", ") })"
|
805
830
|
|
806
831
|
# Dirty Hack: Stop the iteration at most once!
|
807
832
|
# I'll remove this hack if RBS removes the limitation of nesting blocks
|
808
|
-
return
|
833
|
+
return fargs if caller_locations.any? {|frame| frame.label == "show_block_signature" }
|
809
834
|
|
810
835
|
optional = false
|
811
836
|
blks = []
|
@@ -818,12 +843,12 @@ module TypeProf
|
|
818
843
|
end
|
819
844
|
end
|
820
845
|
if blks != []
|
821
|
-
|
822
|
-
|
823
|
-
|
846
|
+
fargs << " " if fargs != ""
|
847
|
+
fargs << "?" if optional
|
848
|
+
fargs << scratch.show_block_signature(blks)
|
824
849
|
end
|
825
850
|
|
826
|
-
|
851
|
+
fargs
|
827
852
|
end
|
828
853
|
end
|
829
854
|
|
@@ -838,6 +863,9 @@ module TypeProf
|
|
838
863
|
@kw_tys = kw_tys
|
839
864
|
kw_tys.each {|a| raise if a.size != 3 } if kw_tys
|
840
865
|
@kw_rest_ty = kw_rest_ty
|
866
|
+
kw_rest_ty&.each_child_global do |ty|
|
867
|
+
raise ty.inspect if ty != Type.any && !ty.is_a?(Type::Hash)
|
868
|
+
end
|
841
869
|
@blk_ty = blk_ty
|
842
870
|
end
|
843
871
|
|
data/lib/typeprof/version.rb
CHANGED
data/smoke/alias.rb
CHANGED
@@ -21,11 +21,11 @@ __END__
|
|
21
21
|
# Classes
|
22
22
|
class Object
|
23
23
|
private
|
24
|
-
def foo: (Integer) -> Integer
|
25
|
-
|
24
|
+
def foo: (Integer | String x) -> (Integer | String)
|
25
|
+
alias bar foo
|
26
26
|
end
|
27
27
|
|
28
28
|
class Test
|
29
|
-
def baz: (Integer) -> Integer
|
30
|
-
|
29
|
+
def baz: (Integer | String x) -> (Integer | String)
|
30
|
+
alias qux baz
|
31
31
|
end
|
data/smoke/alias2.rb
CHANGED
data/smoke/arguments.rb
CHANGED
data/smoke/arguments2.rb
CHANGED
@@ -44,13 +44,13 @@ __END__
|
|
44
44
|
class Object
|
45
45
|
private
|
46
46
|
def f1: -> nil
|
47
|
-
def f2: (:x, :y, :z) -> nil
|
48
|
-
def f3: (?String, ?String) -> nil
|
49
|
-
def f4: (*:a | :b | :c) -> nil
|
50
|
-
def f5: (:x, ?String, :z) -> nil
|
47
|
+
def f2: (:x x, :y y, :z z) -> nil
|
48
|
+
def f3: (?String x, ?String y) -> nil
|
49
|
+
def f4: (*:a | :b | :c r) -> nil
|
50
|
+
def f5: (:x x, ?String y, :z z) -> nil
|
51
51
|
def f6: (k: :kk) -> nil
|
52
52
|
def f7: (?k: Integer) -> nil
|
53
53
|
def f8: (?k: String) -> nil
|
54
|
-
def f9: (
|
54
|
+
def f9: (**:kk) -> nil
|
55
55
|
def f10: { (Integer) -> nil } -> nil
|
56
56
|
end
|
data/smoke/array-each.rb
CHANGED
data/smoke/array-each3.rb
CHANGED
data/smoke/array-map.rb
CHANGED
data/smoke/array-map2.rb
CHANGED
data/smoke/array-map3.rb
CHANGED
@@ -17,7 +17,7 @@ __END__
|
|
17
17
|
# Classes
|
18
18
|
class Object
|
19
19
|
private
|
20
|
-
def map_test: ([Integer, Integer, Integer]) -> Array[String]
|
21
|
-
def map_bang_test: ([Integer, Integer, Integer]) -> (Array[Integer | String])
|
22
|
-
def map_bang_test_known_bug: ([Integer, Integer, Integer]) -> [Integer, Integer, Integer]
|
20
|
+
def map_test: ([Integer, Integer, Integer] a) -> Array[String]
|
21
|
+
def map_bang_test: ([Integer, Integer, Integer] a) -> (Array[Integer | String])
|
22
|
+
def map_bang_test_known_bug: ([Integer, Integer, Integer] a) -> [Integer, Integer, Integer]
|
23
23
|
end
|
data/smoke/array-mul.rb
CHANGED
@@ -13,6 +13,6 @@ __END__
|
|
13
13
|
# Classes
|
14
14
|
class Object
|
15
15
|
private
|
16
|
-
def foo: ([Integer, Integer, Integer]) -> Array[Integer]
|
17
|
-
def bar: ([Integer, Integer, Integer]) -> String
|
16
|
+
def foo: ([Integer, Integer, Integer] a) -> Array[Integer]
|
17
|
+
def bar: ([Integer, Integer, Integer] a) -> String
|
18
18
|
end
|
data/smoke/array-plus1.rb
CHANGED
data/smoke/array-plus2.rb
CHANGED
data/smoke/array-range-aref.rb
CHANGED
@@ -57,15 +57,15 @@ __END__
|
|
57
57
|
# Classes
|
58
58
|
class Object
|
59
59
|
private
|
60
|
-
def f1: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
61
|
-
def f2: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
62
|
-
def f3: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
63
|
-
def f4: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
64
|
-
def f5: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
65
|
-
def f6: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
66
|
-
def f7: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
67
|
-
def f8: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
68
|
-
def f9: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
69
|
-
def f10: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
70
|
-
def dispatch: (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
60
|
+
def f1: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
61
|
+
def f2: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
62
|
+
def f3: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
63
|
+
def f4: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
64
|
+
def f5: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
65
|
+
def f6: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
66
|
+
def f7: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
67
|
+
def f8: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
68
|
+
def f9: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
69
|
+
def f10: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
70
|
+
def dispatch: (*:a | :b | :c | :d | :e ary) -> (Array[:a | :b | :c | :d | :e])
|
71
71
|
end
|
data/smoke/array-replace.rb
CHANGED
data/smoke/array1.rb
CHANGED
@@ -19,9 +19,9 @@ __END__
|
|
19
19
|
# Classes
|
20
20
|
class Object
|
21
21
|
private
|
22
|
-
def foo: ([Integer, String]) -> Integer
|
23
|
-
def bar: (Integer) -> nil
|
24
|
-
def baz: (String) -> nil
|
25
|
-
def qux: (nil) -> nil
|
26
|
-
def quux: (Integer | String) -> nil
|
22
|
+
def foo: ([Integer, String] a) -> Integer
|
23
|
+
def bar: (Integer n) -> nil
|
24
|
+
def baz: (String n) -> nil
|
25
|
+
def qux: (nil n) -> nil
|
26
|
+
def quux: (Integer | String n) -> nil
|
27
27
|
end
|
data/smoke/array10.rb
CHANGED
data/smoke/array11.rb
CHANGED
@@ -10,5 +10,5 @@ __END__
|
|
10
10
|
# Classes
|
11
11
|
class Object
|
12
12
|
private
|
13
|
-
def array: (Array[Integer] | Hash[Integer, Integer] | String) -> (Array[Hash[Integer, Integer] | Integer | String])
|
13
|
+
def array: (Array[Integer] | Hash[Integer, Integer] | String obj) -> (Array[Hash[Integer, Integer] | Integer | String])
|
14
14
|
end
|
data/smoke/array12.rb
CHANGED
data/smoke/array14.rb
CHANGED
data/smoke/array15.rb
CHANGED
data/smoke/array2.rb
CHANGED