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/next2.rb
CHANGED
data/smoke/object-send1.rb
CHANGED
data/smoke/once.rb
CHANGED
data/smoke/optional1.rb
CHANGED
data/smoke/optional2.rb
CHANGED
data/smoke/optional3.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Object
|
|
2
|
+
def foo
|
|
3
|
+
# The receiver is considered as an empty array
|
|
4
|
+
self[0]
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# The elements are dropped when it is passed as a receiver (to avoid state explosion)
|
|
9
|
+
[0].foo
|
|
10
|
+
|
|
11
|
+
__END__
|
|
12
|
+
# Classes
|
|
13
|
+
class Object
|
|
14
|
+
def foo : -> nil
|
|
15
|
+
end
|
data/smoke/pathname1.rb
CHANGED
data/smoke/pathname2.rb
CHANGED
data/smoke/pattern-match1.rb
CHANGED
data/smoke/pattern-match2.rb
CHANGED
data/smoke/proc.rb
CHANGED
data/smoke/proc2.rb
CHANGED
data/smoke/proc3.rb
CHANGED
data/smoke/proc4.rb
CHANGED
data/smoke/range.rb
CHANGED
data/smoke/rbs-alias.rb
CHANGED
data/smoke/rbs-attr.rb
CHANGED
|
@@ -15,11 +15,12 @@ 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
|
|
23
|
+
private
|
|
23
24
|
def read_test_1 : -> Integer
|
|
24
25
|
def read_test_2 : -> Integer
|
|
25
26
|
def write_test : -> String
|
data/smoke/rbs-attr2.rb
ADDED
data/smoke/rbs-attr2.rbs
ADDED
data/smoke/rbs-extend.rb
CHANGED
data/smoke/rbs-interface.rb
CHANGED
data/smoke/rbs-proc1.rb
CHANGED
data/smoke/rbs-proc2.rb
CHANGED
data/smoke/rbs-proc3.rb
CHANGED
data/smoke/rbs-record.rb
CHANGED
data/smoke/rbs-tyvar.rb
CHANGED
data/smoke/rbs-tyvar2.rb
CHANGED
data/smoke/rbs-tyvar3.rb
CHANGED
data/smoke/rbs-tyvar5.rb
CHANGED
data/smoke/rbs-tyvar6.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
def log1(obj) end
|
|
2
|
+
def log2(obj) end
|
|
3
|
+
def log3(obj) end
|
|
4
|
+
|
|
5
|
+
obj = Bar.new("str")
|
|
6
|
+
|
|
7
|
+
log1(obj)
|
|
8
|
+
log2(obj.test_superclass)
|
|
9
|
+
log3(obj.test_module)
|
|
10
|
+
|
|
11
|
+
__END__
|
|
12
|
+
# Classes
|
|
13
|
+
class Object
|
|
14
|
+
private
|
|
15
|
+
def log1 : (Bar[String]) -> nil
|
|
16
|
+
def log2 : (Array[String]) -> nil
|
|
17
|
+
def log3 : (Integer) -> nil
|
|
18
|
+
end
|
data/smoke/rbs-tyvar7.rb
ADDED
data/smoke/rbs-vars.rb
CHANGED
|
@@ -26,12 +26,11 @@ __END__
|
|
|
26
26
|
|
|
27
27
|
# Classes
|
|
28
28
|
class Object
|
|
29
|
+
private
|
|
29
30
|
def gvar_test : -> :gvar_example
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
class Foo
|
|
33
|
-
# @ivar : :ivar_example
|
|
34
|
-
# @@cvar : :cvar_example
|
|
35
34
|
def const_test : -> :const_example
|
|
36
35
|
def ivar_test : -> :ivar_example
|
|
37
36
|
def cvar_test : -> :cvar_example
|
data/smoke/redo1.rb
CHANGED
data/smoke/redo2.rb
CHANGED
data/smoke/req-keyword.rb
CHANGED
data/smoke/rescue1.rb
CHANGED
data/smoke/rescue2.rb
CHANGED
data/smoke/respond_to.rb
CHANGED
data/smoke/rest-farg.rb
CHANGED
data/smoke/rest1.rb
CHANGED
|
@@ -20,6 +20,7 @@ bar("A", "B", "C", "D", "E", "Z")
|
|
|
20
20
|
__END__
|
|
21
21
|
# Classes
|
|
22
22
|
class Object
|
|
23
|
+
private
|
|
23
24
|
def foo : (:a | Integer | String, *Integer | String, :z | Integer | String) -> (Array[Integer | String])
|
|
24
25
|
def bar : (String, ?Integer | String, *String, String) -> Array[String]
|
|
25
26
|
end
|
data/smoke/rest2.rb
CHANGED
data/smoke/rest3.rb
CHANGED
data/smoke/rest4.rb
CHANGED