typeprof 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -3
  3. data/lib/typeprof/analyzer.rb +35 -23
  4. data/lib/typeprof/builtin.rb +37 -3
  5. data/lib/typeprof/config.rb +2 -2
  6. data/lib/typeprof/export.rb +9 -3
  7. data/lib/typeprof/import.rb +4 -11
  8. data/lib/typeprof/method.rb +7 -4
  9. data/lib/typeprof/type.rb +3 -3
  10. data/lib/typeprof/version.rb +1 -1
  11. data/smoke/alias.rb +1 -0
  12. data/smoke/any1.rb +1 -0
  13. data/smoke/any2.rb +1 -0
  14. data/smoke/arguments.rb +1 -0
  15. data/smoke/arguments2.rb +1 -0
  16. data/smoke/array-each.rb +1 -0
  17. data/smoke/array-each2.rb +1 -0
  18. data/smoke/array-each3.rb +1 -0
  19. data/smoke/array-ltlt.rb +1 -0
  20. data/smoke/array-ltlt2.rb +1 -0
  21. data/smoke/array-map.rb +1 -0
  22. data/smoke/array-map2.rb +1 -0
  23. data/smoke/array-map3.rb +1 -0
  24. data/smoke/array-mul.rb +1 -0
  25. data/smoke/array-plus1.rb +1 -0
  26. data/smoke/array-pop.rb +1 -0
  27. data/smoke/array-range-aref.rb +1 -0
  28. data/smoke/array-replace.rb +1 -0
  29. data/smoke/array-s-aref.rb +1 -0
  30. data/smoke/array1.rb +1 -0
  31. data/smoke/array10.rb +1 -0
  32. data/smoke/array11.rb +1 -0
  33. data/smoke/array12.rb +1 -0
  34. data/smoke/array13.rb +1 -0
  35. data/smoke/array14.rb +1 -0
  36. data/smoke/array2.rb +1 -0
  37. data/smoke/array4.rb +1 -0
  38. data/smoke/array5.rb +1 -0
  39. data/smoke/array6.rb +1 -0
  40. data/smoke/array7.rb +1 -0
  41. data/smoke/array9.rb +1 -0
  42. data/smoke/autoload.rb +1 -0
  43. data/smoke/backtrace.rb +1 -0
  44. data/smoke/block-ambiguous.rb +1 -0
  45. data/smoke/block-args1-rest.rb +1 -0
  46. data/smoke/block-args1.rb +1 -0
  47. data/smoke/block-args2-rest.rb +1 -0
  48. data/smoke/block-args2.rb +1 -0
  49. data/smoke/block-args3-rest.rb +1 -0
  50. data/smoke/block-args3.rb +1 -0
  51. data/smoke/block-blockarg.rb +1 -0
  52. data/smoke/block-kwarg.rb +1 -0
  53. data/smoke/block1.rb +1 -0
  54. data/smoke/block10.rb +1 -0
  55. data/smoke/block11.rb +1 -0
  56. data/smoke/block12.rb +1 -0
  57. data/smoke/block14.rb +1 -0
  58. data/smoke/block2.rb +1 -0
  59. data/smoke/block4.rb +1 -0
  60. data/smoke/block5.rb +1 -0
  61. data/smoke/block6.rb +1 -0
  62. data/smoke/block7.rb +1 -0
  63. data/smoke/block8.rb +1 -0
  64. data/smoke/block9.rb +1 -0
  65. data/smoke/blown.rb +1 -0
  66. data/smoke/break1.rb +1 -0
  67. data/smoke/break2.rb +1 -0
  68. data/smoke/case.rb +1 -0
  69. data/smoke/case2.rb +1 -0
  70. data/smoke/class_method3.rb +2 -0
  71. data/smoke/constant2.rb +1 -0
  72. data/smoke/constant3.rb +1 -0
  73. data/smoke/constant4.rb +1 -0
  74. data/smoke/context-sensitive1.rb +1 -0
  75. data/smoke/cvar.rb +1 -0
  76. data/smoke/demo.rb +1 -0
  77. data/smoke/demo1.rb +1 -0
  78. data/smoke/demo10.rb +1 -0
  79. data/smoke/demo11.rb +1 -0
  80. data/smoke/demo2.rb +1 -0
  81. data/smoke/demo3.rb +1 -0
  82. data/smoke/demo7.rb +1 -0
  83. data/smoke/demo8.rb +1 -0
  84. data/smoke/demo9.rb +1 -0
  85. data/smoke/dummy-execution1.rb +1 -0
  86. data/smoke/ensure1.rb +1 -0
  87. data/smoke/enumerator.rb +1 -0
  88. data/smoke/expandarray1.rb +1 -0
  89. data/smoke/expandarray2.rb +1 -0
  90. data/smoke/flow1.rb +1 -0
  91. data/smoke/flow2.rb +1 -0
  92. data/smoke/flow3.rb +1 -0
  93. data/smoke/flow5.rb +1 -0
  94. data/smoke/flow6.rb +1 -0
  95. data/smoke/flow7.rb +1 -0
  96. data/smoke/flow8.rb +1 -0
  97. data/smoke/freeze.rb +1 -0
  98. data/smoke/function.rb +1 -0
  99. data/smoke/gvar.rb +1 -0
  100. data/smoke/gvar2.rb +1 -0
  101. data/smoke/hash-fetch.rb +1 -0
  102. data/smoke/hash-merge-bang.rb +1 -0
  103. data/smoke/hash1.rb +1 -0
  104. data/smoke/hash2.rb +1 -0
  105. data/smoke/hash3.rb +1 -0
  106. data/smoke/hash4.rb +1 -0
  107. data/smoke/initialize.rb +1 -0
  108. data/smoke/int_times.rb +1 -0
  109. data/smoke/integer.rb +1 -0
  110. data/smoke/ivar.rb +1 -0
  111. data/smoke/kernel-class.rb +1 -0
  112. data/smoke/keyword1.rb +1 -0
  113. data/smoke/keyword2.rb +1 -0
  114. data/smoke/keyword3.rb +1 -0
  115. data/smoke/keyword4.rb +1 -0
  116. data/smoke/keyword5.rb +1 -0
  117. data/smoke/kwsplat1.rb +1 -0
  118. data/smoke/kwsplat2.rb +1 -0
  119. data/smoke/manual-rbs.rb +1 -0
  120. data/smoke/manual-rbs2.rb +1 -0
  121. data/smoke/masgn1.rb +1 -0
  122. data/smoke/masgn2.rb +1 -0
  123. data/smoke/masgn3.rb +1 -0
  124. data/smoke/method_in_branch.rb +1 -0
  125. data/smoke/next1.rb +1 -0
  126. data/smoke/next2.rb +1 -0
  127. data/smoke/object-send1.rb +1 -0
  128. data/smoke/once.rb +1 -0
  129. data/smoke/optional1.rb +1 -0
  130. data/smoke/optional2.rb +1 -0
  131. data/smoke/optional3.rb +1 -0
  132. data/smoke/parameterizedd-self.rb +1 -0
  133. data/smoke/pathname1.rb +1 -0
  134. data/smoke/pathname2.rb +1 -0
  135. data/smoke/pattern-match1.rb +1 -0
  136. data/smoke/pattern-match2.rb +1 -0
  137. data/smoke/proc.rb +1 -0
  138. data/smoke/proc2.rb +1 -0
  139. data/smoke/proc3.rb +1 -0
  140. data/smoke/proc4.rb +1 -0
  141. data/smoke/range.rb +1 -0
  142. data/smoke/rbs-alias.rb +1 -0
  143. data/smoke/rbs-attr.rb +1 -0
  144. data/smoke/rbs-extend.rb +1 -0
  145. data/smoke/rbs-interface.rb +1 -0
  146. data/smoke/rbs-proc1.rb +1 -0
  147. data/smoke/rbs-proc2.rb +1 -0
  148. data/smoke/rbs-proc3.rb +1 -0
  149. data/smoke/rbs-record.rb +1 -0
  150. data/smoke/rbs-tyvar.rb +1 -0
  151. data/smoke/rbs-tyvar2.rb +1 -0
  152. data/smoke/rbs-tyvar3.rb +1 -0
  153. data/smoke/rbs-tyvar5.rb +1 -0
  154. data/smoke/rbs-tyvar6.rb +1 -0
  155. data/smoke/rbs-tyvar7.rb +1 -0
  156. data/smoke/rbs-vars.rb +1 -0
  157. data/smoke/redo1.rb +1 -0
  158. data/smoke/redo2.rb +1 -0
  159. data/smoke/req-keyword.rb +1 -0
  160. data/smoke/rescue1.rb +1 -0
  161. data/smoke/rescue2.rb +1 -0
  162. data/smoke/respond_to.rb +1 -0
  163. data/smoke/rest-farg.rb +1 -0
  164. data/smoke/rest1.rb +1 -0
  165. data/smoke/rest2.rb +1 -0
  166. data/smoke/rest3.rb +1 -0
  167. data/smoke/rest4.rb +1 -0
  168. data/smoke/rest5.rb +1 -0
  169. data/smoke/rest6.rb +1 -0
  170. data/smoke/retry1.rb +1 -0
  171. data/smoke/return.rb +1 -0
  172. data/smoke/step.rb +1 -0
  173. data/smoke/string-split.rb +1 -0
  174. data/smoke/struct2.rb +1 -0
  175. data/smoke/super1.rb +1 -0
  176. data/smoke/svar1.rb +1 -0
  177. data/smoke/symbol-proc.rb +1 -0
  178. data/smoke/tap1.rb +1 -0
  179. data/smoke/toplevel.rb +1 -0
  180. data/smoke/two-map.rb +1 -0
  181. data/smoke/type_var.rb +1 -0
  182. data/smoke/typed_method.rb +1 -0
  183. data/smoke/uninitialize-var.rb +1 -0
  184. metadata +3 -3
@@ -13,6 +13,7 @@ bar
13
13
  __END__
14
14
  # Classes
15
15
  class Object
16
+ private
16
17
  def foo : { (Integer) -> bot } -> bot
17
18
  def bar : -> String
18
19
  end
@@ -11,5 +11,6 @@ foo
11
11
  __END__
12
12
  # Classes
13
13
  class Object
14
+ private
14
15
  def foo : -> (Integer | String)
15
16
  end
@@ -12,5 +12,6 @@ foo
12
12
  __END__
13
13
  # Classes
14
14
  class Object
15
+ private
15
16
  def foo : -> ((:sym | Integer)?)
16
17
  end
@@ -13,5 +13,6 @@ foo
13
13
  __END__
14
14
  # Classes
15
15
  class Object
16
+ private
16
17
  def foo : -> ((:sym | Integer)?)
17
18
  end
@@ -19,9 +19,11 @@ v.foo
19
19
  __END__
20
20
  # Classes
21
21
  class ForWin
22
+ private
22
23
  def self.foo : -> nil
23
24
  end
24
25
 
25
26
  class ForLinux
27
+ private
26
28
  def self.foo : -> nil
27
29
  end
@@ -25,6 +25,7 @@ smoke/constant2.rb:15: [warning] already initialized constant Object::BAR
25
25
  # Classes
26
26
  class Object
27
27
  BAR : String
28
+ private
28
29
  def foo : (Integer | untyped) -> nil
29
30
  def log : (String) -> nil
30
31
  end
@@ -5,5 +5,6 @@ foo
5
5
  __END__
6
6
  # Classes
7
7
  class Object
8
+ private
8
9
  def foo : -> untyped
9
10
  end
@@ -7,5 +7,6 @@ foo
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : -> Complex
11
12
  end
@@ -8,5 +8,6 @@ foo(x || 1)
8
8
  __END__
9
9
  # Classes
10
10
  class Object
11
+ private
11
12
  def foo : (Integer) -> Integer
12
13
  end
@@ -18,6 +18,7 @@ A.new.foo
18
18
  __END__
19
19
  # Classes
20
20
  class Object
21
+ private
21
22
  def log1 : (Integer) -> nil
22
23
  def log2 : (Integer) -> nil
23
24
  end
@@ -65,6 +65,7 @@ B.new.foo("str")
65
65
  __END__
66
66
  # Classes
67
67
  class Object
68
+ private
68
69
  def foo : (bool) -> (Integer | String)
69
70
  def identity : (:sym | Integer | String) -> (:sym | Integer | String)
70
71
  def fib : (Integer) -> Integer
@@ -12,5 +12,6 @@ foo(false)
12
12
  __END__
13
13
  # Classes
14
14
  class Object
15
+ private
15
16
  def foo : (bool) -> (Integer | String)
16
17
  end
@@ -15,6 +15,7 @@ foo
15
15
  __END__
16
16
  # Classes
17
17
  class Object
18
+ private
18
19
  def bar : { -> String } -> String
19
20
  def foo : -> (Integer | String)
20
21
  end
@@ -7,5 +7,6 @@ swap(a)
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def swap : ([Integer, String]) -> [String, Integer]
11
12
  end
@@ -10,5 +10,6 @@ my_to_s(:sym)
10
10
  __END__
11
11
  # Classes
12
12
  class Object
13
+ private
13
14
  def my_to_s : (:sym | Integer | String) -> String
14
15
  end
@@ -12,5 +12,6 @@ fib(40000)
12
12
  __END__
13
13
  # Classes
14
14
  class Object
15
+ private
15
16
  def fib : (Integer) -> Integer
16
17
  end
@@ -10,5 +10,6 @@ end
10
10
  __END__
11
11
  # Classes
12
12
  class Object
13
+ private
13
14
  def foo : (Integer) { (Integer) -> String } -> String
14
15
  end
@@ -13,6 +13,7 @@ bar(&blk)
13
13
  __END__
14
14
  # Classes
15
15
  class Object
16
+ private
16
17
  def foo : { (:sym | String) -> (:sym | String) } -> (:sym | String)
17
18
  def bar : { (:sym | String) -> (:sym | String) } -> (:sym | String)
18
19
  end
@@ -12,5 +12,6 @@ __END__
12
12
  # Classes
13
13
  class Object
14
14
  F : ^(Integer) -> String
15
+ private
15
16
  def foo : { (:sym) -> String } -> String
16
17
  end
@@ -9,6 +9,7 @@ end
9
9
  __END__
10
10
  # Classes
11
11
  class Object
12
+ private
12
13
  def foo : (Integer | untyped) -> (Integer | untyped)
13
14
  def bar : -> (Integer | untyped)
14
15
  end
@@ -15,6 +15,7 @@ bar
15
15
  __END__
16
16
  # Classes
17
17
  class Object
18
+ private
18
19
  def foo : ((:sym | Integer | String)?) -> Integer
19
20
  def bar : -> :sym
20
21
  end
@@ -10,6 +10,7 @@ fuga
10
10
  __END__
11
11
  # Classes
12
12
  class Object
13
+ private
13
14
  def hoge : -> Enumerator[Integer]
14
15
  def fuga : -> Enumerator[Integer]
15
16
  end
@@ -18,5 +18,6 @@ smoke/expandarray1.rb:3: [error] undefined method: Object#unknown
18
18
 
19
19
  # Classes
20
20
  class Object
21
+ private
21
22
  def foo : -> ([:a, [:b, :c]] | untyped)
22
23
  end
@@ -19,5 +19,6 @@ smoke/expandarray2.rb:3: [error] undefined method: Object#unknown
19
19
 
20
20
  # Classes
21
21
  class Object
22
+ private
22
23
  def foo : -> ([:a, [:b, :c]] | untyped)
23
24
  end
@@ -12,5 +12,6 @@ foo("str")
12
12
  __END__
13
13
  # Classes
14
14
  class Object
15
+ private
15
16
  def foo : (Integer | String) -> (Integer | String)
16
17
  end
@@ -10,5 +10,6 @@ smoke/flow2.rb:5: [error] undefined method: Object#unknown
10
10
 
11
11
  # Classes
12
12
  class Object
13
+ private
13
14
  def foo : (untyped) -> Integer
14
15
  end
@@ -10,5 +10,6 @@ foo(nil)
10
10
  __END__
11
11
  # Classes
12
12
  class Object
13
+ private
13
14
  def foo : (Integer?) -> Integer?
14
15
  end
@@ -15,5 +15,6 @@ foo("1")
15
15
  __END__
16
16
  # Classes
17
17
  class Object
18
+ private
18
19
  def foo : (Integer | String) -> Integer
19
20
  end
@@ -15,5 +15,6 @@ foo("1")
15
15
  __END__
16
16
  # Classes
17
17
  class Object
18
+ private
18
19
  def foo : (Integer | String) -> String
19
20
  end
@@ -16,5 +16,6 @@ foo(:sym)
16
16
  __END__
17
17
  # Classes
18
18
  class Object
19
+ private
19
20
  def foo : (:sym | Integer | String) -> (:sym | Integer | String)
20
21
  end
@@ -9,5 +9,6 @@ foo(nil)
9
9
  __END__
10
10
  # Classes
11
11
  class Object
12
+ private
12
13
  def foo : (Integer?) -> Integer
13
14
  end
@@ -7,5 +7,6 @@ foo
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : -> [Integer]
11
12
  end
@@ -11,6 +11,7 @@ one_argument(1)
11
11
  __END__
12
12
  # Classes
13
13
  class Object
14
+ private
14
15
  def no_argument : -> String
15
16
  def one_argument : (Integer) -> nil
16
17
  end
@@ -9,5 +9,6 @@ $foo : Integer | String
9
9
 
10
10
  # Classes
11
11
  class Object
12
+ private
12
13
  def log : (Integer | String) -> nil
13
14
  end
@@ -13,5 +13,6 @@ smoke/gvar2.rb:1: [warning] inconsistent assignment to RBS-declared global varia
13
13
 
14
14
  # Classes
15
15
  class Object
16
+ private
16
17
  def log : -> String
17
18
  end
@@ -21,6 +21,7 @@ baz(h)
21
21
  __END__
22
22
  # Classes
23
23
  class Object
24
+ private
24
25
  def foo : ({a: :A, b: :B}) -> (:A | :B)
25
26
  def bar : ({a: :A, b: :B}) -> (:A | :B | :C)
26
27
  def baz : ({a: :A, b: :B}) -> ([:A | :B | :C, (:a | :b)?])
@@ -7,5 +7,6 @@ end
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : -> [{a: Integer}, {a: Integer, b: String}]
11
12
  end
@@ -14,6 +14,7 @@ bar
14
14
  __END__
15
15
  # Classes
16
16
  class Object
17
+ private
17
18
  def foo : -> {int: Integer, str: String}
18
19
  def bar : -> (Hash[Integer | String, Integer | String])
19
20
  end
@@ -8,5 +8,6 @@ foo
8
8
  __END__
9
9
  # Classes
10
10
  class Object
11
+ private
11
12
  def foo : -> Integer
12
13
  end
@@ -9,5 +9,6 @@ foo
9
9
  __END__
10
10
  # Classes
11
11
  class Object
12
+ private
12
13
  def foo : -> {int: Integer, str: String}
13
14
  end
@@ -6,5 +6,6 @@ foo
6
6
  __END__
7
7
  # Classes
8
8
  class Object
9
+ private
9
10
  def foo : -> Hash[bot, bot]
10
11
  end
@@ -15,6 +15,7 @@ A.new(nil)
15
15
  __END__
16
16
  # Classes
17
17
  class Object
18
+ private
18
19
  def log : (A) -> nil
19
20
  end
20
21
 
@@ -10,5 +10,6 @@ foo(42)
10
10
  __END__
11
11
  # Classes
12
12
  class Object
13
+ private
13
14
  def foo : (Integer) -> (Integer | String)
14
15
  end
@@ -6,5 +6,6 @@ foo(Integer("str"))
6
6
  __END__
7
7
  # Classes
8
8
  class Object
9
+ private
9
10
  def foo : (Integer) -> nil
10
11
  end
@@ -19,6 +19,7 @@ log(Foo.new.foo)
19
19
  __END__
20
20
  # Classes
21
21
  class Object
22
+ private
22
23
  def log : (Integer | String) -> nil
23
24
  end
24
25
 
@@ -8,5 +8,6 @@ foo("")
8
8
  __END__
9
9
  # Classes
10
10
  class Object
11
+ private
11
12
  def foo : (Integer | String) -> (singleton(Integer) | singleton(String))
12
13
  end
@@ -7,5 +7,6 @@ foo(n: 42, s: "str")
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : (n: Integer, s: String) -> [Integer, String]
11
12
  end
@@ -7,5 +7,6 @@ foo(n: 42, s: "str")
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : (?n: Integer, ?s: Integer | String) -> ([Integer, Integer | String])
11
12
  end
@@ -7,5 +7,6 @@ foo(n: 42, s: "str")
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : (?n: Integer, ?s: String | [Integer]) -> ([Integer, String | [Integer]])
11
12
  end
@@ -7,5 +7,6 @@ foo(n: 42, s: "str")
7
7
  __END__
8
8
  # Classes
9
9
  class Object
10
+ private
10
11
  def foo : (**{n: Integer, s: String}) -> {n: Integer, s: String}
11
12
  end
@@ -11,5 +11,6 @@ smoke/keyword5.rb:5: [error] no argument for required keywords
11
11
 
12
12
  # Classes
13
13
  class Object
14
+ private
14
15
  def foo : (req: Integer) -> Integer
15
16
  end
@@ -35,6 +35,7 @@ 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
@@ -8,5 +8,6 @@ foo(*a, **h)
8
8
  __END__
9
9
  # Classes
10
10
  class Object
11
+ private
11
12
  def foo : (*Integer | {k: Integer}, k: Integer) -> nil
12
13
  end
@@ -22,6 +22,7 @@ __END__
22
22
  class Object
23
23
  # def foo : (Integer) -> Integer
24
24
  # | (String) -> String
25
+ private
25
26
  def ret_int : -> Integer
26
27
  def ret_str : -> String
27
28
  end