typeprof 0.5.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -4
- data/doc/doc.ja.md +3 -4
- data/doc/doc.md +3 -4
- data/lib/typeprof/analyzer.rb +248 -166
- data/lib/typeprof/arguments.rb +12 -6
- data/lib/typeprof/builtin.rb +123 -23
- data/lib/typeprof/cli.rb +33 -34
- data/lib/typeprof/config.rb +6 -4
- data/lib/typeprof/container-type.rb +175 -112
- data/lib/typeprof/export.rb +23 -17
- data/lib/typeprof/import.rb +58 -53
- data/lib/typeprof/method.rb +59 -125
- data/lib/typeprof/type.rb +26 -14
- data/lib/typeprof/version.rb +1 -1
- data/smoke/alias.rb +1 -0
- data/smoke/any1.rb +1 -0
- data/smoke/any2.rb +1 -0
- data/smoke/arguments.rb +1 -0
- data/smoke/arguments2.rb +1 -0
- data/smoke/array-each.rb +1 -0
- data/smoke/array-each2.rb +1 -0
- data/smoke/array-each3.rb +2 -1
- data/smoke/array-ltlt.rb +1 -0
- data/smoke/array-ltlt2.rb +1 -0
- data/smoke/array-map.rb +1 -0
- data/smoke/array-map2.rb +1 -0
- data/smoke/array-map3.rb +1 -0
- data/smoke/array-mul.rb +1 -0
- data/smoke/array-plus1.rb +1 -0
- data/smoke/array-pop.rb +1 -0
- data/smoke/array-range-aref.rb +71 -0
- data/smoke/array-replace.rb +1 -0
- data/smoke/array-s-aref.rb +1 -0
- data/smoke/array1.rb +1 -0
- data/smoke/array10.rb +1 -0
- data/smoke/array11.rb +2 -1
- data/smoke/array12.rb +1 -0
- data/smoke/array13.rb +1 -0
- data/smoke/array14.rb +1 -0
- data/smoke/array2.rb +1 -0
- data/smoke/array4.rb +1 -0
- data/smoke/array5.rb +1 -0
- data/smoke/array6.rb +3 -2
- data/smoke/array7.rb +1 -0
- data/smoke/array8.rb +1 -1
- data/smoke/array9.rb +1 -0
- data/smoke/autoload.rb +14 -0
- data/smoke/backtrace.rb +1 -0
- data/smoke/block-ambiguous.rb +1 -0
- data/smoke/block-args1-rest.rb +1 -0
- data/smoke/block-args1.rb +1 -0
- data/smoke/block-args2-rest.rb +1 -0
- data/smoke/block-args2.rb +4 -3
- data/smoke/block-args3-rest.rb +1 -0
- data/smoke/block-args3.rb +5 -4
- data/smoke/block-blockarg.rb +2 -1
- data/smoke/block-kwarg.rb +1 -0
- data/smoke/block1.rb +1 -0
- data/smoke/block10.rb +1 -0
- data/smoke/block11.rb +1 -0
- data/smoke/block12.rb +1 -0
- data/smoke/block14.rb +1 -0
- data/smoke/block2.rb +1 -0
- data/smoke/block4.rb +1 -0
- data/smoke/block5.rb +2 -1
- data/smoke/block6.rb +1 -0
- data/smoke/block7.rb +1 -0
- data/smoke/block8.rb +1 -0
- data/smoke/block9.rb +1 -0
- data/smoke/blown.rb +1 -0
- data/smoke/break1.rb +1 -0
- data/smoke/break2.rb +1 -0
- data/smoke/case.rb +1 -0
- data/smoke/case2.rb +1 -0
- data/smoke/class_method3.rb +2 -0
- data/smoke/constant2.rb +2 -2
- data/smoke/constant3.rb +1 -0
- data/smoke/constant4.rb +1 -0
- data/smoke/context-sensitive1.rb +1 -0
- data/smoke/cvar.rb +1 -0
- data/smoke/define_method.rb +16 -0
- data/smoke/define_method2.rb +18 -0
- data/smoke/demo.rb +1 -0
- data/smoke/demo1.rb +1 -0
- data/smoke/demo10.rb +1 -0
- data/smoke/demo11.rb +1 -0
- data/smoke/demo2.rb +1 -0
- data/smoke/demo3.rb +1 -0
- data/smoke/demo5.rb +1 -1
- data/smoke/demo7.rb +1 -0
- data/smoke/demo8.rb +1 -0
- data/smoke/demo9.rb +2 -1
- data/smoke/dummy-execution1.rb +1 -0
- data/smoke/ensure1.rb +1 -0
- data/smoke/enumerator.rb +1 -0
- data/smoke/expandarray1.rb +1 -0
- data/smoke/expandarray2.rb +1 -0
- data/smoke/flow1.rb +1 -0
- data/smoke/flow2.rb +1 -0
- data/smoke/flow3.rb +1 -0
- data/smoke/flow5.rb +1 -0
- data/smoke/flow6.rb +1 -0
- data/smoke/flow7.rb +1 -0
- data/smoke/flow8.rb +1 -0
- data/smoke/freeze.rb +1 -0
- data/smoke/function.rb +1 -0
- data/smoke/gvar.rb +1 -0
- data/smoke/gvar2.rb +1 -0
- data/smoke/hash-fetch.rb +1 -0
- data/smoke/hash-merge-bang.rb +1 -0
- data/smoke/hash1.rb +3 -1
- data/smoke/hash2.rb +1 -0
- data/smoke/hash3.rb +1 -0
- data/smoke/hash4.rb +2 -1
- data/smoke/inheritance2.rb +2 -2
- data/smoke/initialize.rb +1 -0
- data/smoke/int_times.rb +1 -0
- data/smoke/integer.rb +1 -0
- data/smoke/ivar.rb +1 -0
- data/smoke/ivar2.rb +1 -1
- data/smoke/kernel-class.rb +2 -1
- data/smoke/keyword1.rb +1 -0
- data/smoke/keyword2.rb +1 -0
- data/smoke/keyword3.rb +1 -0
- data/smoke/keyword4.rb +1 -0
- data/smoke/keyword5.rb +1 -0
- data/smoke/kwrest.rb +12 -0
- data/smoke/kwrest.rbs +3 -0
- data/smoke/kwsplat1.rb +2 -1
- data/smoke/kwsplat2.rb +1 -0
- data/smoke/manual-rbs.rb +1 -0
- data/smoke/manual-rbs2.rb +1 -0
- data/smoke/masgn1.rb +1 -0
- data/smoke/masgn2.rb +1 -0
- data/smoke/masgn3.rb +1 -0
- data/smoke/method_in_branch.rb +1 -0
- data/smoke/method_missing.rb +28 -0
- data/smoke/multiple-superclass.rb +1 -1
- data/smoke/next1.rb +1 -0
- data/smoke/next2.rb +1 -0
- data/smoke/object-send1.rb +1 -0
- data/smoke/once.rb +1 -0
- data/smoke/optional1.rb +1 -0
- data/smoke/optional2.rb +1 -0
- data/smoke/optional3.rb +1 -0
- data/smoke/parameterizedd-self.rb +3 -2
- data/smoke/parameterizedd-self2.rb +15 -0
- data/smoke/pathname1.rb +1 -0
- data/smoke/pathname2.rb +1 -0
- data/smoke/pattern-match1.rb +1 -0
- data/smoke/pattern-match2.rb +1 -0
- data/smoke/proc.rb +1 -0
- data/smoke/proc2.rb +1 -0
- data/smoke/proc3.rb +1 -0
- data/smoke/proc4.rb +1 -0
- data/smoke/range.rb +1 -0
- data/smoke/rbs-alias.rb +1 -0
- data/smoke/rbs-attr.rb +3 -2
- data/smoke/rbs-attr2.rb +11 -0
- data/smoke/rbs-attr2.rbs +3 -0
- data/smoke/rbs-extend.rb +1 -0
- data/smoke/rbs-interface.rb +1 -0
- data/smoke/rbs-proc1.rb +1 -0
- data/smoke/rbs-proc2.rb +1 -0
- data/smoke/rbs-proc3.rb +1 -0
- data/smoke/rbs-record.rb +1 -0
- data/smoke/rbs-tyvar.rb +1 -0
- data/smoke/rbs-tyvar2.rb +1 -0
- data/smoke/rbs-tyvar3.rb +1 -0
- data/smoke/rbs-tyvar5.rb +1 -0
- data/smoke/rbs-tyvar6.rb +18 -0
- data/smoke/rbs-tyvar6.rbs +12 -0
- data/smoke/rbs-tyvar7.rb +12 -0
- data/smoke/rbs-tyvar7.rbs +7 -0
- data/smoke/rbs-vars.rb +1 -2
- data/smoke/redo1.rb +1 -0
- data/smoke/redo2.rb +1 -0
- data/smoke/req-keyword.rb +1 -0
- data/smoke/rescue1.rb +1 -0
- data/smoke/rescue2.rb +1 -0
- data/smoke/respond_to.rb +1 -0
- data/smoke/rest-farg.rb +1 -0
- data/smoke/rest1.rb +1 -0
- data/smoke/rest2.rb +1 -0
- data/smoke/rest3.rb +1 -0
- data/smoke/rest4.rb +1 -0
- data/smoke/rest5.rb +1 -0
- data/smoke/rest6.rb +1 -0
- data/smoke/retry1.rb +1 -0
- data/smoke/return.rb +1 -0
- data/smoke/step.rb +1 -0
- data/smoke/string-split.rb +1 -0
- data/smoke/struct.rb +2 -2
- data/smoke/struct2.rb +1 -0
- data/smoke/super1.rb +1 -0
- data/smoke/super4.rb +43 -0
- data/smoke/super5.rb +36 -0
- data/smoke/svar1.rb +1 -0
- data/smoke/symbol-proc.rb +1 -0
- data/smoke/tap1.rb +1 -0
- data/smoke/toplevel.rb +1 -0
- data/smoke/two-map.rb +1 -0
- data/smoke/type_var.rb +1 -0
- data/smoke/typed_method.rb +1 -0
- data/smoke/uninitialize-var.rb +1 -0
- data/smoke/union-recv.rb +2 -2
- metadata +18 -2
data/smoke/demo8.rb
CHANGED
data/smoke/demo9.rb
CHANGED
data/smoke/dummy-execution1.rb
CHANGED
data/smoke/ensure1.rb
CHANGED
data/smoke/enumerator.rb
CHANGED
data/smoke/expandarray1.rb
CHANGED
data/smoke/expandarray2.rb
CHANGED
data/smoke/flow1.rb
CHANGED
data/smoke/flow2.rb
CHANGED
data/smoke/flow3.rb
CHANGED
data/smoke/flow5.rb
CHANGED
data/smoke/flow6.rb
CHANGED
data/smoke/flow7.rb
CHANGED
data/smoke/flow8.rb
CHANGED
data/smoke/freeze.rb
CHANGED
data/smoke/function.rb
CHANGED
data/smoke/gvar.rb
CHANGED
data/smoke/gvar2.rb
CHANGED
data/smoke/hash-fetch.rb
CHANGED
data/smoke/hash-merge-bang.rb
CHANGED
data/smoke/hash1.rb
CHANGED
@@ -5,6 +5,7 @@ end
|
|
5
5
|
foo
|
6
6
|
|
7
7
|
def bar
|
8
|
+
# This returns {Integer=>Integer | String, String=>String} but RBS cannot express it
|
8
9
|
{ 1 => 1, 2 => "str", "s" => "s" }
|
9
10
|
end
|
10
11
|
|
@@ -13,6 +14,7 @@ bar
|
|
13
14
|
__END__
|
14
15
|
# Classes
|
15
16
|
class Object
|
17
|
+
private
|
16
18
|
def foo : -> {int: Integer, str: String}
|
17
|
-
def bar : -> (
|
19
|
+
def bar : -> (Hash[Integer | String, Integer | String])
|
18
20
|
end
|
data/smoke/hash2.rb
CHANGED
data/smoke/hash3.rb
CHANGED
data/smoke/hash4.rb
CHANGED
data/smoke/inheritance2.rb
CHANGED
@@ -21,11 +21,11 @@ end
|
|
21
21
|
__END__
|
22
22
|
# Classes
|
23
23
|
class SuperBase
|
24
|
-
def self.foo : -> (A
|
24
|
+
def self.foo : -> (singleton(A) | singleton(B))
|
25
25
|
end
|
26
26
|
|
27
27
|
class Base < SuperBase
|
28
|
-
def self.foo : -> (A
|
28
|
+
def self.foo : -> (singleton(A) | singleton(B))
|
29
29
|
end
|
30
30
|
|
31
31
|
class A < Base
|
data/smoke/initialize.rb
CHANGED
data/smoke/int_times.rb
CHANGED
data/smoke/integer.rb
CHANGED
data/smoke/ivar.rb
CHANGED
data/smoke/ivar2.rb
CHANGED
data/smoke/kernel-class.rb
CHANGED
data/smoke/keyword1.rb
CHANGED
data/smoke/keyword2.rb
CHANGED
data/smoke/keyword3.rb
CHANGED
data/smoke/keyword4.rb
CHANGED
data/smoke/keyword5.rb
CHANGED
data/smoke/kwrest.rb
ADDED
data/smoke/kwrest.rbs
ADDED
data/smoke/kwsplat1.rb
CHANGED
@@ -35,8 +35,9 @@ smoke/kwsplat1.rb:30: [error] undefined method: Object#any
|
|
35
35
|
|
36
36
|
# Classes
|
37
37
|
class Object
|
38
|
+
private
|
38
39
|
def foo : (k: Integer) -> nil
|
39
40
|
def bar : (int: Integer, str: String) -> nil
|
40
41
|
def baz : (**{int: Integer, str: String}) -> nil
|
41
|
-
def qux : (**
|
42
|
+
def qux : (**Hash[untyped, untyped]) -> nil
|
42
43
|
end
|
data/smoke/kwsplat2.rb
CHANGED
data/smoke/manual-rbs.rb
CHANGED
data/smoke/manual-rbs2.rb
CHANGED
data/smoke/masgn1.rb
CHANGED
data/smoke/masgn2.rb
CHANGED
data/smoke/masgn3.rb
CHANGED
data/smoke/method_in_branch.rb
CHANGED
@@ -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
|