typeprof 0.6.1 → 0.7.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 +2 -2
- data/doc/doc.ja.md +3 -4
- data/doc/doc.md +3 -4
- data/lib/typeprof/analyzer.rb +95 -80
- data/lib/typeprof/arguments.rb +12 -6
- data/lib/typeprof/builtin.rb +75 -20
- data/lib/typeprof/cli.rb +33 -34
- data/lib/typeprof/config.rb +4 -2
- data/lib/typeprof/container-type.rb +153 -99
- data/lib/typeprof/export.rb +9 -9
- data/lib/typeprof/import.rb +23 -32
- data/lib/typeprof/method.rb +45 -131
- data/lib/typeprof/type.rb +8 -2
- data/lib/typeprof/version.rb +1 -1
- data/smoke/array-each3.rb +1 -1
- data/smoke/array-range-aref.rb +70 -0
- data/smoke/autoload.rb +13 -0
- data/smoke/define_method.rb +16 -0
- data/smoke/define_method2.rb +18 -0
- data/smoke/kwrest.rb +12 -0
- data/smoke/kwrest.rbs +3 -0
- data/smoke/method_missing.rb +28 -0
- data/smoke/rbs-attr.rb +2 -2
- data/smoke/rbs-attr2.rb +11 -0
- data/smoke/rbs-attr2.rbs +3 -0
- data/smoke/rbs-tyvar7.rb +11 -0
- data/smoke/rbs-tyvar7.rbs +7 -0
- data/smoke/rbs-vars.rb +0 -2
- metadata +13 -2
data/lib/typeprof/version.rb
CHANGED
data/smoke/array-each3.rb
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
def f1(*ary)
|
2
|
+
ary[1..3]
|
3
|
+
end
|
4
|
+
|
5
|
+
def f2(*ary)
|
6
|
+
ary[1...3]
|
7
|
+
end
|
8
|
+
|
9
|
+
def f3(*ary)
|
10
|
+
ary[1..-3]
|
11
|
+
end
|
12
|
+
|
13
|
+
def f4(*ary)
|
14
|
+
ary[1...-3]
|
15
|
+
end
|
16
|
+
|
17
|
+
def f5(*ary)
|
18
|
+
ary[-4..3]
|
19
|
+
end
|
20
|
+
|
21
|
+
def f6(*ary)
|
22
|
+
ary[-4...3]
|
23
|
+
end
|
24
|
+
|
25
|
+
def f7(*ary)
|
26
|
+
ary[-4..-3]
|
27
|
+
end
|
28
|
+
|
29
|
+
def f8(*ary)
|
30
|
+
ary[-4...-3]
|
31
|
+
end
|
32
|
+
|
33
|
+
def f9(*ary)
|
34
|
+
ary[...3]
|
35
|
+
end
|
36
|
+
|
37
|
+
def f10(*ary)
|
38
|
+
ary[3..]
|
39
|
+
end
|
40
|
+
|
41
|
+
def dispatch(*ary)
|
42
|
+
f1(*ary)
|
43
|
+
f2(*ary)
|
44
|
+
f3(*ary)
|
45
|
+
f4(*ary)
|
46
|
+
f5(*ary)
|
47
|
+
f6(*ary)
|
48
|
+
f7(*ary)
|
49
|
+
f8(*ary)
|
50
|
+
f9(*ary)
|
51
|
+
f10(*ary)
|
52
|
+
end
|
53
|
+
|
54
|
+
dispatch(:a, :b, :c, :d, :e)
|
55
|
+
|
56
|
+
__END__
|
57
|
+
# Classes
|
58
|
+
class Object
|
59
|
+
def f1 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
60
|
+
def f2 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
61
|
+
def f3 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
62
|
+
def f4 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
63
|
+
def f5 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
64
|
+
def f6 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
65
|
+
def f7 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
66
|
+
def f8 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
67
|
+
def f9 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
68
|
+
def f10 : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
69
|
+
def dispatch : (*:a | :b | :c | :d | :e) -> (Array[:a | :b | :c | :d | :e])
|
70
|
+
end
|
data/smoke/autoload.rb
ADDED
data/smoke/kwrest.rb
ADDED
data/smoke/kwrest.rbs
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
class D
|
2
|
+
def foo(x, y, z)
|
3
|
+
end
|
4
|
+
end
|
5
|
+
|
6
|
+
class C
|
7
|
+
def initialize(x)
|
8
|
+
@target = x
|
9
|
+
end
|
10
|
+
|
11
|
+
def method_missing(m, *args)
|
12
|
+
@target.send(m, *args)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
C.new(D.new).foo(:X, :Y, :Z)
|
17
|
+
|
18
|
+
__END__
|
19
|
+
# Classes
|
20
|
+
class D
|
21
|
+
def foo : (:X, :Y, :Z) -> nil
|
22
|
+
end
|
23
|
+
|
24
|
+
class C
|
25
|
+
@target : D
|
26
|
+
def initialize : (D) -> D
|
27
|
+
def method_missing : (:foo, *:X | :Y | :Z) -> nil
|
28
|
+
end
|
data/smoke/rbs-attr.rb
CHANGED
@@ -15,8 +15,8 @@ end
|
|
15
15
|
|
16
16
|
__END__
|
17
17
|
# Errors
|
18
|
-
smoke/rbs-attr.rb:11: [
|
19
|
-
smoke/rbs-attr.rb:13: [
|
18
|
+
smoke/rbs-attr.rb:11: [warning] inconsistent assignment to RBS-declared global variable
|
19
|
+
smoke/rbs-attr.rb:13: [warning] inconsistent assignment to RBS-declared global variable
|
20
20
|
|
21
21
|
# Classes
|
22
22
|
class Object
|
data/smoke/rbs-attr2.rb
ADDED
data/smoke/rbs-attr2.rbs
ADDED
data/smoke/rbs-tyvar7.rb
ADDED
data/smoke/rbs-vars.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typeprof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Endoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbs
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- smoke/array-plus1.rb
|
85
85
|
- smoke/array-plus2.rb
|
86
86
|
- smoke/array-pop.rb
|
87
|
+
- smoke/array-range-aref.rb
|
87
88
|
- smoke/array-replace.rb
|
88
89
|
- smoke/array-s-aref.rb
|
89
90
|
- smoke/array1.rb
|
@@ -101,6 +102,7 @@ files:
|
|
101
102
|
- smoke/array8.rb
|
102
103
|
- smoke/array9.rb
|
103
104
|
- smoke/attr.rb
|
105
|
+
- smoke/autoload.rb
|
104
106
|
- smoke/backtrace.rb
|
105
107
|
- smoke/block-ambiguous.rb
|
106
108
|
- smoke/block-args1-rest.rb
|
@@ -145,6 +147,8 @@ files:
|
|
145
147
|
- smoke/context-sensitive1.rb
|
146
148
|
- smoke/cvar.rb
|
147
149
|
- smoke/cvar2.rb
|
150
|
+
- smoke/define_method.rb
|
151
|
+
- smoke/define_method2.rb
|
148
152
|
- smoke/demo.rb
|
149
153
|
- smoke/demo1.rb
|
150
154
|
- smoke/demo10.rb
|
@@ -201,6 +205,8 @@ files:
|
|
201
205
|
- smoke/keyword3.rb
|
202
206
|
- smoke/keyword4.rb
|
203
207
|
- smoke/keyword5.rb
|
208
|
+
- smoke/kwrest.rb
|
209
|
+
- smoke/kwrest.rbs
|
204
210
|
- smoke/kwsplat1.rb
|
205
211
|
- smoke/kwsplat2.rb
|
206
212
|
- smoke/manual-rbs.rb
|
@@ -213,6 +219,7 @@ files:
|
|
213
219
|
- smoke/masgn2.rb
|
214
220
|
- smoke/masgn3.rb
|
215
221
|
- smoke/method_in_branch.rb
|
222
|
+
- smoke/method_missing.rb
|
216
223
|
- smoke/module1.rb
|
217
224
|
- smoke/module2.rb
|
218
225
|
- smoke/module3.rb
|
@@ -244,6 +251,8 @@ files:
|
|
244
251
|
- smoke/rbs-alias.rbs
|
245
252
|
- smoke/rbs-attr.rb
|
246
253
|
- smoke/rbs-attr.rbs
|
254
|
+
- smoke/rbs-attr2.rb
|
255
|
+
- smoke/rbs-attr2.rbs
|
247
256
|
- smoke/rbs-extend.rb
|
248
257
|
- smoke/rbs-extend.rbs
|
249
258
|
- smoke/rbs-interface.rb
|
@@ -267,6 +276,8 @@ files:
|
|
267
276
|
- smoke/rbs-tyvar5.rbs
|
268
277
|
- smoke/rbs-tyvar6.rb
|
269
278
|
- smoke/rbs-tyvar6.rbs
|
279
|
+
- smoke/rbs-tyvar7.rb
|
280
|
+
- smoke/rbs-tyvar7.rbs
|
270
281
|
- smoke/rbs-vars.rb
|
271
282
|
- smoke/rbs-vars.rbs
|
272
283
|
- smoke/redo1.rb
|