steep 0.40.0 → 0.44.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/Gemfile +1 -0
  4. data/bin/output_rebaseline.rb +15 -30
  5. data/bin/output_test.rb +23 -57
  6. data/lib/steep.rb +89 -15
  7. data/lib/steep/annotation_parser.rb +10 -2
  8. data/lib/steep/ast/types/class.rb +4 -0
  9. data/lib/steep/cli.rb +31 -6
  10. data/lib/steep/diagnostic/ruby.rb +13 -8
  11. data/lib/steep/diagnostic/signature.rb +152 -2
  12. data/lib/steep/drivers/annotations.rb +18 -36
  13. data/lib/steep/drivers/check.rb +140 -31
  14. data/lib/steep/drivers/diagnostic_printer.rb +20 -11
  15. data/lib/steep/drivers/langserver.rb +4 -8
  16. data/lib/steep/drivers/print_project.rb +10 -9
  17. data/lib/steep/drivers/stats.rb +135 -119
  18. data/lib/steep/drivers/utils/driver_helper.rb +35 -0
  19. data/lib/steep/drivers/utils/jobs_count.rb +9 -0
  20. data/lib/steep/drivers/validate.rb +29 -18
  21. data/lib/steep/drivers/watch.rb +55 -49
  22. data/lib/steep/drivers/worker.rb +11 -8
  23. data/lib/steep/expectations.rb +159 -0
  24. data/lib/steep/index/signature_symbol_provider.rb +23 -1
  25. data/lib/steep/index/source_index.rb +55 -5
  26. data/lib/steep/interface/block.rb +4 -0
  27. data/lib/steep/project.rb +0 -30
  28. data/lib/steep/project/dsl.rb +5 -3
  29. data/lib/steep/project/pattern.rb +56 -0
  30. data/lib/steep/project/target.rb +11 -227
  31. data/lib/steep/server/base_worker.rb +1 -3
  32. data/lib/steep/server/change_buffer.rb +63 -0
  33. data/lib/steep/server/interaction_worker.rb +72 -57
  34. data/lib/steep/server/master.rb +652 -234
  35. data/lib/steep/server/type_check_worker.rb +304 -0
  36. data/lib/steep/server/worker_process.rb +16 -11
  37. data/lib/steep/{project → services}/completion_provider.rb +5 -5
  38. data/lib/steep/services/content_change.rb +61 -0
  39. data/lib/steep/services/file_loader.rb +48 -0
  40. data/lib/steep/services/goto_service.rb +321 -0
  41. data/lib/steep/{project → services}/hover_content.rb +19 -20
  42. data/lib/steep/services/path_assignment.rb +27 -0
  43. data/lib/steep/services/signature_service.rb +403 -0
  44. data/lib/steep/services/stats_calculator.rb +69 -0
  45. data/lib/steep/services/type_check_service.rb +413 -0
  46. data/lib/steep/signature/validator.rb +187 -85
  47. data/lib/steep/source.rb +21 -18
  48. data/lib/steep/subtyping/check.rb +246 -45
  49. data/lib/steep/subtyping/constraints.rb +4 -4
  50. data/lib/steep/type_construction.rb +428 -193
  51. data/lib/steep/type_inference/block_params.rb +1 -1
  52. data/lib/steep/type_inference/context.rb +22 -0
  53. data/lib/steep/type_inference/local_variable_type_env.rb +26 -12
  54. data/lib/steep/type_inference/logic.rb +1 -1
  55. data/lib/steep/type_inference/logic_type_interpreter.rb +4 -4
  56. data/lib/steep/type_inference/type_env.rb +43 -17
  57. data/lib/steep/version.rb +1 -1
  58. data/smoke/alias/test_expectations.yml +96 -0
  59. data/smoke/and/test_expectations.yml +31 -0
  60. data/smoke/array/test_expectations.yml +103 -0
  61. data/smoke/block/test_expectations.yml +125 -0
  62. data/smoke/case/test_expectations.yml +47 -0
  63. data/smoke/class/test_expectations.yml +120 -0
  64. data/smoke/const/test_expectations.yml +129 -0
  65. data/smoke/diagnostics-rbs-duplicated/test_expectations.yml +13 -0
  66. data/smoke/diagnostics-rbs/Steepfile +7 -4
  67. data/smoke/diagnostics-rbs/test_expectations.yml +231 -0
  68. data/smoke/diagnostics-rbs/unknown-type-name-2.rbs +5 -0
  69. data/smoke/{broken → diagnostics-ruby-unsat}/Steepfile +0 -0
  70. data/smoke/diagnostics-ruby-unsat/a.rbs +3 -0
  71. data/smoke/diagnostics-ruby-unsat/test_expectations.yml +27 -0
  72. data/smoke/{diagnostics → diagnostics-ruby-unsat}/unsatisfiable_constraint.rb +0 -1
  73. data/smoke/diagnostics/a.rbs +0 -4
  74. data/smoke/diagnostics/test_expectations.yml +451 -0
  75. data/smoke/dstr/test_expectations.yml +13 -0
  76. data/smoke/ensure/test_expectations.yml +62 -0
  77. data/smoke/enumerator/test_expectations.yml +135 -0
  78. data/smoke/extension/f.rb +2 -0
  79. data/smoke/extension/f.rbs +3 -0
  80. data/smoke/extension/test_expectations.yml +73 -0
  81. data/smoke/hash/test_expectations.yml +81 -0
  82. data/smoke/hello/test_expectations.yml +25 -0
  83. data/smoke/if/test_expectations.yml +34 -0
  84. data/smoke/implements/b.rb +13 -0
  85. data/smoke/implements/b.rbs +12 -0
  86. data/smoke/implements/test_expectations.yml +23 -0
  87. data/smoke/initialize/test_expectations.yml +1 -0
  88. data/smoke/integer/test_expectations.yml +101 -0
  89. data/smoke/interface/test_expectations.yml +23 -0
  90. data/smoke/kwbegin/test_expectations.yml +17 -0
  91. data/smoke/lambda/test_expectations.yml +39 -0
  92. data/smoke/literal/test_expectations.yml +106 -0
  93. data/smoke/map/test_expectations.yml +1 -0
  94. data/smoke/method/test_expectations.yml +90 -0
  95. data/smoke/module/test_expectations.yml +75 -0
  96. data/smoke/regexp/test_expectations.yml +615 -0
  97. data/smoke/regression/issue_328.rb +1 -0
  98. data/smoke/regression/issue_328.rbs +0 -0
  99. data/smoke/regression/issue_332.rb +11 -0
  100. data/smoke/regression/issue_332.rbs +19 -0
  101. data/smoke/regression/issue_372.rb +8 -0
  102. data/smoke/regression/issue_372.rbs +4 -0
  103. data/smoke/regression/masgn.rb +4 -0
  104. data/smoke/regression/test_expectations.yml +60 -0
  105. data/smoke/regression/thread.rb +7 -0
  106. data/smoke/rescue/test_expectations.yml +79 -0
  107. data/smoke/self/test_expectations.yml +23 -0
  108. data/smoke/skip/test_expectations.yml +23 -0
  109. data/smoke/stdout/test_expectations.yml +1 -0
  110. data/smoke/super/test_expectations.yml +69 -0
  111. data/smoke/toplevel/test_expectations.yml +15 -0
  112. data/smoke/tsort/Steepfile +2 -0
  113. data/smoke/tsort/test_expectations.yml +63 -0
  114. data/smoke/type_case/test_expectations.yml +48 -0
  115. data/smoke/unexpected/Steepfile +5 -0
  116. data/smoke/unexpected/test_expectations.yml +25 -0
  117. data/smoke/unexpected/unexpected.rb +1 -0
  118. data/smoke/unexpected/unexpected.rbs +3 -0
  119. data/smoke/yield/test_expectations.yml +68 -0
  120. data/steep.gemspec +4 -3
  121. metadata +127 -80
  122. data/lib/steep/project/file_loader.rb +0 -68
  123. data/lib/steep/project/signature_file.rb +0 -39
  124. data/lib/steep/project/source_file.rb +0 -129
  125. data/lib/steep/project/stats_calculator.rb +0 -80
  126. data/lib/steep/server/code_worker.rb +0 -150
  127. data/lib/steep/server/signature_worker.rb +0 -157
  128. data/lib/steep/server/utils.rb +0 -69
  129. data/smoke/alias/test.yaml +0 -73
  130. data/smoke/and/test.yaml +0 -24
  131. data/smoke/array/test.yaml +0 -80
  132. data/smoke/block/test.yaml +0 -96
  133. data/smoke/broken/broken.rb +0 -0
  134. data/smoke/broken/broken.rbs +0 -0
  135. data/smoke/broken/test.yaml +0 -6
  136. data/smoke/case/test.yaml +0 -36
  137. data/smoke/class/test.yaml +0 -89
  138. data/smoke/const/test.yaml +0 -96
  139. data/smoke/diagnostics-rbs-duplicated/test.yaml +0 -10
  140. data/smoke/diagnostics-rbs/test.yaml +0 -142
  141. data/smoke/diagnostics/test.yaml +0 -333
  142. data/smoke/dstr/test.yaml +0 -10
  143. data/smoke/ensure/test.yaml +0 -47
  144. data/smoke/enumerator/test.yaml +0 -100
  145. data/smoke/extension/test.yaml +0 -50
  146. data/smoke/hash/test.yaml +0 -62
  147. data/smoke/hello/test.yaml +0 -18
  148. data/smoke/if/test.yaml +0 -27
  149. data/smoke/implements/test.yaml +0 -16
  150. data/smoke/initialize/test.yaml +0 -4
  151. data/smoke/integer/test.yaml +0 -66
  152. data/smoke/interface/test.yaml +0 -16
  153. data/smoke/kwbegin/test.yaml +0 -14
  154. data/smoke/lambda/test.yaml +0 -28
  155. data/smoke/literal/test.yaml +0 -79
  156. data/smoke/map/test.yaml +0 -4
  157. data/smoke/method/test.yaml +0 -71
  158. data/smoke/module/test.yaml +0 -51
  159. data/smoke/regexp/test.yaml +0 -372
  160. data/smoke/regression/test.yaml +0 -38
  161. data/smoke/rescue/test.yaml +0 -60
  162. data/smoke/self/test.yaml +0 -16
  163. data/smoke/skip/test.yaml +0 -16
  164. data/smoke/stdout/test.yaml +0 -4
  165. data/smoke/super/test.yaml +0 -52
  166. data/smoke/toplevel/test.yaml +0 -12
  167. data/smoke/tsort/test.yaml +0 -32
  168. data/smoke/type_case/test.yaml +0 -33
  169. data/smoke/yield/test.yaml +0 -49
data/smoke/dstr/test.yaml DELETED
@@ -1,10 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:5:15: [error] Type `::Integer` does not have method `foo`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ b = "Hello #{a.foo} world!"
10
- ~~~
@@ -1,47 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:7:6: [error] Cannot assign a value of type `::Symbol` to a variable of type `::Integer`
7
- │ ::Symbol <: ::Integer
8
- │ ::Object <: ::Integer
9
- │ ::BasicObject <: ::Integer
10
-
11
- │ Diagnostic ID: Ruby::IncompatibleAssignment
12
-
13
- └ b = :foo
14
- ~~~~~~~~
15
- - |
16
- a.rb:4:0: [error] Cannot assign a value of type `::String` to a variable of type `::Integer`
17
- │ ::String <: ::Integer
18
- │ ::Object <: ::Integer
19
- │ ::BasicObject <: ::Integer
20
-
21
- │ Diagnostic ID: Ruby::IncompatibleAssignment
22
-
23
- └ a = begin
24
- ~~~~~~~~~
25
- - |
26
- a.rb:16:2: [error] Cannot find compatible overloading of method `+` of type `::Integer`
27
- │ Method types:
28
- │ def +: (::Integer) -> ::Integer
29
- │ | (::Float) -> ::Float
30
- │ | (::Rational) -> ::Rational
31
- │ | (::Complex) -> ::Complex
32
-
33
- │ Diagnostic ID: Ruby::UnresolvedOverloading
34
-
35
- └ 1 + '1'
36
- ~~~~~~~
37
- - |
38
- a.rb:13:0: [error] Cannot allow method body have type `::Integer` because declared as type `::String`
39
- │ ::Integer <: ::String
40
- │ ::Numeric <: ::String
41
- │ ::Object <: ::String
42
- │ ::BasicObject <: ::String
43
-
44
- │ Diagnostic ID: Ruby::MethodBodyTypeMismatch
45
-
46
- └ def foo(a)
47
- ~~~~~~~~~~
@@ -1,100 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:6:2: [error] Cannot assign a value of type `::Integer` to a variable of type `::Hash[::Symbol, ::String]`
7
- │ ::Integer <: ::Hash[::Symbol, ::String]
8
- │ ::Numeric <: ::Hash[::Symbol, ::String]
9
- │ ::Object <: ::Hash[::Symbol, ::String]
10
- │ ::BasicObject <: ::Hash[::Symbol, ::String]
11
-
12
- │ Diagnostic ID: Ruby::IncompatibleAssignment
13
-
14
- └ hash = x
15
- ~~~~~~~~
16
- - |
17
- a.rb:7:2: [error] Cannot assign a value of type `::String` to a variable of type `::Hash[::Symbol, ::String]`
18
- │ ::String <: ::Hash[::Symbol, ::String]
19
- │ ::Object <: ::Hash[::Symbol, ::String]
20
- │ ::BasicObject <: ::Hash[::Symbol, ::String]
21
-
22
- │ Diagnostic ID: Ruby::IncompatibleAssignment
23
-
24
- └ hash = y
25
- ~~~~~~~~
26
- - |
27
- a.rb:5:0: [error] Cannot assign a value of type `::String` to a variable of type `::Hash[::Symbol, ::String]`
28
- │ ::String <: ::Hash[::Symbol, ::String]
29
- │ ::Object <: ::Hash[::Symbol, ::String]
30
- │ ::BasicObject <: ::Hash[::Symbol, ::String]
31
-
32
- │ Diagnostic ID: Ruby::IncompatibleAssignment
33
-
34
- └ hash = a.each.with_object("") do |x, y|
35
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
- - |
37
- a.rb:11:2: [error] Cannot assign a value of type `::Integer` to a variable of type `::Hash[::Symbol, ::String]`
38
- │ ::Integer <: ::Hash[::Symbol, ::String]
39
- │ ::Numeric <: ::Hash[::Symbol, ::String]
40
- │ ::Object <: ::Hash[::Symbol, ::String]
41
- │ ::BasicObject <: ::Hash[::Symbol, ::String]
42
-
43
- │ Diagnostic ID: Ruby::IncompatibleAssignment
44
-
45
- └ hash = x
46
- ~~~~~~~~
47
- - |
48
- a.rb:12:2: [error] Cannot assign a value of type `::Integer` to a variable of type `::Hash[::Symbol, ::String]`
49
- │ ::Integer <: ::Hash[::Symbol, ::String]
50
- │ ::Numeric <: ::Hash[::Symbol, ::String]
51
- │ ::Object <: ::Hash[::Symbol, ::String]
52
- │ ::BasicObject <: ::Hash[::Symbol, ::String]
53
-
54
- │ Diagnostic ID: Ruby::IncompatibleAssignment
55
-
56
- └ hash = y
57
- ~~~~~~~~
58
- - |
59
- a.rb:10:0: [error] Cannot assign a value of type `::Array[::Integer]` to a variable of type `::Hash[::Symbol, ::String]`
60
- │ ::Array[::Integer] <: ::Hash[::Symbol, ::String]
61
- │ ::Object <: ::Hash[::Symbol, ::String]
62
- │ ::BasicObject <: ::Hash[::Symbol, ::String]
63
-
64
- │ Diagnostic ID: Ruby::IncompatibleAssignment
65
-
66
- └ hash = a.each.with_index do |x, y|
67
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68
- b.rb:
69
- diagnostics:
70
- - |
71
- b.rb:6:4: [error] Cannot find compatible overloading of method `with_object` of type `::Enumerator[::Integer, ::Array[::Integer]]`
72
- │ Method types:
73
- │ def with_object: [U] (U) { (::Integer, U) -> untyped } -> U
74
- │ | [U] (U) -> ::Enumerator[[::Integer, U], ::Array[::Integer]]
75
-
76
- │ Diagnostic ID: Ruby::UnresolvedOverloading
77
-
78
- └ b = a.each.with_object([]) do |i, xs|
79
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80
- - |
81
- b.rb:11:0: [error] Cannot assign a value of type `::Array[::String]` to a variable of type `::Array[::Integer]`
82
- │ ::Array[::String] <: ::Array[::Integer]
83
- │ ::String <: ::Integer
84
- │ ::Object <: ::Integer
85
- │ ::BasicObject <: ::Integer
86
-
87
- │ Diagnostic ID: Ruby::IncompatibleAssignment
88
-
89
- └ c = a.each.with_object([]) do |i, xs|
90
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91
- - |
92
- b.rb:17:0: [error] Cannot assign a value of type `::Array[untyped]` to a variable of type `::String`
93
- │ ::Array[untyped] <: ::String
94
- │ ::Object <: ::String
95
- │ ::BasicObject <: ::String
96
-
97
- │ Diagnostic ID: Ruby::IncompatibleAssignment
98
-
99
- └ d = a.each.with_object([]) do |i, xs|
100
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1,50 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:8:2: [error] Cannot assign a value of type `::Foo` to a variable of type `::String`
7
- │ ::Foo <: ::String
8
- │ ::Object <: ::String
9
- │ ::BasicObject <: ::String
10
-
11
- │ Diagnostic ID: Ruby::IncompatibleAssignment
12
-
13
- └ string = x
14
- ~~~~~~~~~~
15
- b.rb:
16
- diagnostics:
17
- - |
18
- b.rb:7:0: [error] Cannot assign a value of type `::String` to a variable of type `::Integer`
19
- │ ::String <: ::Integer
20
- │ ::Object <: ::Integer
21
- │ ::BasicObject <: ::Integer
22
-
23
- │ Diagnostic ID: Ruby::IncompatibleAssignment
24
-
25
- └ integer = foo.f()
26
- ~~~~~~~~~~~~~~~~~
27
- - |
28
- b.rb:10:0: [error] Cannot assign a value of type `::Object` to a variable of type `::Integer`
29
- │ ::Object <: ::Integer
30
- │ ::BasicObject <: ::Integer
31
-
32
- │ Diagnostic ID: Ruby::IncompatibleAssignment
33
-
34
- └ integer = "".f()
35
- ~~~~~~~~~~~~~~~~
36
- c.rb:
37
- diagnostics:
38
- - |
39
- c.rb:6:4: [error] Cannot assign a value of type `::Object` to a variable of type `::String`
40
- │ ::Object <: ::String
41
- │ ::BasicObject <: ::String
42
-
43
- │ Diagnostic ID: Ruby::IncompatibleAssignment
44
-
45
- └ string = super()
46
- ~~~~~~~~~~~~~~~~
47
- d.rb:
48
- diagnostics: []
49
- e.rb:
50
- diagnostics: []
data/smoke/hash/test.yaml DELETED
@@ -1,62 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics: []
5
- b.rb:
6
- diagnostics:
7
- - |
8
- b.rb:6:0: [error] Cannot assign a value of type `::Hash[::Symbol, ::Integer]` to a variable of type `::Hash[::Symbol, (::String | nil)]`
9
- │ ::Hash[::Symbol, ::Integer] <: ::Hash[::Symbol, (::String | nil)]
10
- │ ::Integer <: (::String | nil)
11
- │ ::Integer <: ::String
12
- │ ::Numeric <: ::String
13
- │ ::Object <: ::String
14
- │ ::BasicObject <: ::String
15
-
16
- │ Diagnostic ID: Ruby::IncompatibleAssignment
17
-
18
- └ x = { foo: 3 }
19
- ~~~~~~~~~~~~~~
20
- c.rb:
21
- diagnostics:
22
- - |
23
- c.rb:5:3: [error] Type `::Integer` does not have method `abcdefg`
24
- │ Diagnostic ID: Ruby::NoMethod
25
-
26
- └ id.abcdefg
27
- ~~~~~~~
28
- - |
29
- c.rb:8:5: [error] Type `::String` does not have method `abcdefg`
30
- │ Diagnostic ID: Ruby::NoMethod
31
-
32
- └ name.abcdefg
33
- ~~~~~~~
34
- - |
35
- c.rb:10:30: [error] Type `(::Integer | ::String)` does not have method `abcdefg`
36
- │ Diagnostic ID: Ruby::NoMethod
37
-
38
- └ params[(_=nil) ? :id : :name].abcdefg
39
- ~~~~~~~
40
- d.rb:
41
- diagnostics:
42
- - |
43
- d.rb:5:0: [error] Cannot assign a value of type `{ :email => ::String, :id => ::String, :name => ::String }` to a variable of type `{ :id => ::Integer, :name => ::String }`
44
- │ { :email => ::String, :id => ::String, :name => ::String } <: { :id => ::Integer, :name => ::String }
45
- │ ::String <: ::Integer
46
- │ ::Object <: ::Integer
47
- │ ::BasicObject <: ::Integer
48
-
49
- │ Diagnostic ID: Ruby::IncompatibleAssignment
50
-
51
- └ params = { id: "30", name: "foo", email: "matsumoto@soutaro.com" }
52
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
- e.rb:
54
- diagnostics:
55
- - |
56
- e.rb:1:24: [error] Type `::Integer` does not have method `fffffffffffff`
57
- │ Diagnostic ID: Ruby::NoMethod
58
-
59
- └ Foo.new.get({ foo: 3 }).fffffffffffff
60
- ~~~~~~~~~~~~~
61
- f.rb:
62
- diagnostics: []
@@ -1,18 +0,0 @@
1
- ---
2
- test:
3
- hello.rb:
4
- diagnostics:
5
- - |
6
- hello.rb:9:6: [error] Type `::_Bar` does not have method `foo`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ b = y.foo
10
- ~~~
11
- - |
12
- hello.rb:11:0: [error] Cannot assign a value of type `::_Bar` to a variable of type `::_Foo`
13
- │ ::_Bar <: ::_Foo
14
-
15
- │ Diagnostic ID: Ruby::IncompatibleAssignment
16
-
17
- └ x = y
18
- ~~~~~
data/smoke/if/test.yaml DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:5:0: [error] Cannot assign a value of type `(::Symbol | nil)` to a variable of type `::String`
7
- │ (::Symbol | nil) <: ::String
8
- │ ::Symbol <: ::String
9
- │ ::Object <: ::String
10
- │ ::BasicObject <: ::String
11
-
12
- │ Diagnostic ID: Ruby::IncompatibleAssignment
13
-
14
- └ a = if x
15
- ~~~~~~~~
16
- - |
17
- a.rb:15:0: [error] Cannot assign a value of type `(::String | ::Integer)` to a variable of type `::String`
18
- │ (::String | ::Integer) <: ::String
19
- │ ::Integer <: ::String
20
- │ ::Numeric <: ::String
21
- │ ::Object <: ::String
22
- │ ::BasicObject <: ::String
23
-
24
- │ Diagnostic ID: Ruby::IncompatibleAssignment
25
-
26
- └ a = if z
27
- ~~~~~~~~
@@ -1,16 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:1:6: [error] Cannot find implementation of method `::A#baz`
7
- │ Diagnostic ID: Ruby::MethodDefinitionMissing
8
-
9
- └ class A
10
- ~
11
- - |
12
- a.rb:1:6: [error] Cannot find implementation of method `::A.bar`
13
- │ Diagnostic ID: Ruby::MethodDefinitionMissing
14
-
15
- └ class A
16
- ~
@@ -1,4 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics: []
@@ -1,66 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:4:10: [error] Type `::Integer` does not have method `foo`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ integer_1.foo
10
- ~~~
11
- - |
12
- a.rb:7:10: [error] Type `::Integer` does not have method `foo`
13
- │ Diagnostic ID: Ruby::NoMethod
14
-
15
- └ integer_2.foo
16
- ~~~
17
- - |
18
- a.rb:12:20: [error] Cannot detect the type of the expression
19
- │ Diagnostic ID: Ruby::FallbackAny
20
-
21
- └ integer_3 = Integer(WithToInt.new)
22
- ~~~~~~~~~
23
- - |
24
- a.rb:13:10: [error] Type `::Integer` does not have method `foo`
25
- │ Diagnostic ID: Ruby::NoMethod
26
-
27
- └ integer_3.foo
28
- ~~~
29
- - |
30
- a.rb:18:20: [error] Cannot detect the type of the expression
31
- │ Diagnostic ID: Ruby::FallbackAny
32
-
33
- └ integer_4 = Integer(WithToI.new)
34
- ~~~~~~~
35
- - |
36
- a.rb:19:10: [error] Type `::Integer` does not have method `foo`
37
- │ Diagnostic ID: Ruby::NoMethod
38
-
39
- └ integer_4.foo
40
- ~~~
41
- - |
42
- a.rb:22:10: [error] Type `::Integer` does not have method `foo`
43
- │ Diagnostic ID: Ruby::NoMethod
44
-
45
- └ integer_5.foo
46
- ~~~
47
- - |
48
- a.rb:24:0: [error] Cannot find compatible overloading of method `Integer` of type `::Object`
49
- │ Method types:
50
- │ def Integer: ((::Numeric | ::String), ?exception: bool) -> ::Integer
51
- │ | (::String, ?::Integer, ?exception: bool) -> ::Integer
52
-
53
- │ Diagnostic ID: Ruby::UnresolvedOverloading
54
-
55
- └ Integer(Object.new)
56
- ~~~~~~~~~~~~~~~~~~~
57
- - |
58
- a.rb:26:0: [error] Cannot find compatible overloading of method `Integer` of type `::Object`
59
- │ Method types:
60
- │ def Integer: ((::Numeric | ::String), ?exception: bool) -> ::Integer
61
- │ | (::String, ?::Integer, ?exception: bool) -> ::Integer
62
-
63
- │ Diagnostic ID: Ruby::UnresolvedOverloading
64
-
65
- └ Integer(nil)
66
- ~~~~~~~~~~~~
@@ -1,16 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:5:12: [error] Type `::A::Object` does not have method `bar`
7
- │ Diagnostic ID: Ruby::NoMethod
8
-
9
- └ foo.foo.bar
10
- ~~~
11
- - |
12
- a.rb:10:11: [error] Type `::Object` does not have method `object?`
13
- │ Diagnostic ID: Ruby::NoMethod
14
-
15
- └ object.object?
16
- ~~~~~~~
@@ -1,14 +0,0 @@
1
- ---
2
- test:
3
- a.rb:
4
- diagnostics:
5
- - |
6
- a.rb:3:0: [error] Cannot assign a value of type `::String` to a variable of type `::Integer`
7
- │ ::String <: ::Integer
8
- │ ::Object <: ::Integer
9
- │ ::BasicObject <: ::Integer
10
-
11
- │ Diagnostic ID: Ruby::IncompatibleAssignment
12
-
13
- └ a = begin
14
- ~~~~~~~~~