steep 0.40.0 → 0.44.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -0
- data/Gemfile +1 -0
- data/bin/output_rebaseline.rb +15 -30
- data/bin/output_test.rb +23 -57
- data/lib/steep.rb +89 -15
- data/lib/steep/annotation_parser.rb +10 -2
- data/lib/steep/ast/types/class.rb +4 -0
- data/lib/steep/cli.rb +31 -6
- data/lib/steep/diagnostic/ruby.rb +13 -8
- data/lib/steep/diagnostic/signature.rb +152 -2
- data/lib/steep/drivers/annotations.rb +18 -36
- data/lib/steep/drivers/check.rb +140 -31
- data/lib/steep/drivers/diagnostic_printer.rb +20 -11
- data/lib/steep/drivers/langserver.rb +4 -8
- data/lib/steep/drivers/print_project.rb +10 -9
- data/lib/steep/drivers/stats.rb +135 -119
- data/lib/steep/drivers/utils/driver_helper.rb +35 -0
- data/lib/steep/drivers/utils/jobs_count.rb +9 -0
- data/lib/steep/drivers/validate.rb +29 -18
- data/lib/steep/drivers/watch.rb +55 -49
- data/lib/steep/drivers/worker.rb +11 -8
- data/lib/steep/expectations.rb +159 -0
- data/lib/steep/index/signature_symbol_provider.rb +23 -1
- data/lib/steep/index/source_index.rb +55 -5
- data/lib/steep/interface/block.rb +4 -0
- data/lib/steep/project.rb +0 -30
- data/lib/steep/project/dsl.rb +5 -3
- data/lib/steep/project/pattern.rb +56 -0
- data/lib/steep/project/target.rb +11 -227
- data/lib/steep/server/base_worker.rb +1 -3
- data/lib/steep/server/change_buffer.rb +63 -0
- data/lib/steep/server/interaction_worker.rb +72 -57
- data/lib/steep/server/master.rb +652 -234
- data/lib/steep/server/type_check_worker.rb +304 -0
- data/lib/steep/server/worker_process.rb +16 -11
- data/lib/steep/{project → services}/completion_provider.rb +5 -5
- data/lib/steep/services/content_change.rb +61 -0
- data/lib/steep/services/file_loader.rb +48 -0
- data/lib/steep/services/goto_service.rb +321 -0
- data/lib/steep/{project → services}/hover_content.rb +19 -20
- data/lib/steep/services/path_assignment.rb +27 -0
- data/lib/steep/services/signature_service.rb +403 -0
- data/lib/steep/services/stats_calculator.rb +69 -0
- data/lib/steep/services/type_check_service.rb +413 -0
- data/lib/steep/signature/validator.rb +187 -85
- data/lib/steep/source.rb +21 -18
- data/lib/steep/subtyping/check.rb +246 -45
- data/lib/steep/subtyping/constraints.rb +4 -4
- data/lib/steep/type_construction.rb +428 -193
- data/lib/steep/type_inference/block_params.rb +1 -1
- data/lib/steep/type_inference/context.rb +22 -0
- data/lib/steep/type_inference/local_variable_type_env.rb +26 -12
- data/lib/steep/type_inference/logic.rb +1 -1
- data/lib/steep/type_inference/logic_type_interpreter.rb +4 -4
- data/lib/steep/type_inference/type_env.rb +43 -17
- data/lib/steep/version.rb +1 -1
- data/smoke/alias/test_expectations.yml +96 -0
- data/smoke/and/test_expectations.yml +31 -0
- data/smoke/array/test_expectations.yml +103 -0
- data/smoke/block/test_expectations.yml +125 -0
- data/smoke/case/test_expectations.yml +47 -0
- data/smoke/class/test_expectations.yml +120 -0
- data/smoke/const/test_expectations.yml +129 -0
- data/smoke/diagnostics-rbs-duplicated/test_expectations.yml +13 -0
- data/smoke/diagnostics-rbs/Steepfile +7 -4
- data/smoke/diagnostics-rbs/test_expectations.yml +231 -0
- data/smoke/diagnostics-rbs/unknown-type-name-2.rbs +5 -0
- data/smoke/{broken → diagnostics-ruby-unsat}/Steepfile +0 -0
- data/smoke/diagnostics-ruby-unsat/a.rbs +3 -0
- data/smoke/diagnostics-ruby-unsat/test_expectations.yml +27 -0
- data/smoke/{diagnostics → diagnostics-ruby-unsat}/unsatisfiable_constraint.rb +0 -1
- data/smoke/diagnostics/a.rbs +0 -4
- data/smoke/diagnostics/test_expectations.yml +451 -0
- data/smoke/dstr/test_expectations.yml +13 -0
- data/smoke/ensure/test_expectations.yml +62 -0
- data/smoke/enumerator/test_expectations.yml +135 -0
- data/smoke/extension/f.rb +2 -0
- data/smoke/extension/f.rbs +3 -0
- data/smoke/extension/test_expectations.yml +73 -0
- data/smoke/hash/test_expectations.yml +81 -0
- data/smoke/hello/test_expectations.yml +25 -0
- data/smoke/if/test_expectations.yml +34 -0
- data/smoke/implements/b.rb +13 -0
- data/smoke/implements/b.rbs +12 -0
- data/smoke/implements/test_expectations.yml +23 -0
- data/smoke/initialize/test_expectations.yml +1 -0
- data/smoke/integer/test_expectations.yml +101 -0
- data/smoke/interface/test_expectations.yml +23 -0
- data/smoke/kwbegin/test_expectations.yml +17 -0
- data/smoke/lambda/test_expectations.yml +39 -0
- data/smoke/literal/test_expectations.yml +106 -0
- data/smoke/map/test_expectations.yml +1 -0
- data/smoke/method/test_expectations.yml +90 -0
- data/smoke/module/test_expectations.yml +75 -0
- data/smoke/regexp/test_expectations.yml +615 -0
- data/smoke/regression/issue_328.rb +1 -0
- data/smoke/regression/issue_328.rbs +0 -0
- data/smoke/regression/issue_332.rb +11 -0
- data/smoke/regression/issue_332.rbs +19 -0
- data/smoke/regression/issue_372.rb +8 -0
- data/smoke/regression/issue_372.rbs +4 -0
- data/smoke/regression/masgn.rb +4 -0
- data/smoke/regression/test_expectations.yml +60 -0
- data/smoke/regression/thread.rb +7 -0
- data/smoke/rescue/test_expectations.yml +79 -0
- data/smoke/self/test_expectations.yml +23 -0
- data/smoke/skip/test_expectations.yml +23 -0
- data/smoke/stdout/test_expectations.yml +1 -0
- data/smoke/super/test_expectations.yml +69 -0
- data/smoke/toplevel/test_expectations.yml +15 -0
- data/smoke/tsort/Steepfile +2 -0
- data/smoke/tsort/test_expectations.yml +63 -0
- data/smoke/type_case/test_expectations.yml +48 -0
- data/smoke/unexpected/Steepfile +5 -0
- data/smoke/unexpected/test_expectations.yml +25 -0
- data/smoke/unexpected/unexpected.rb +1 -0
- data/smoke/unexpected/unexpected.rbs +3 -0
- data/smoke/yield/test_expectations.yml +68 -0
- data/steep.gemspec +4 -3
- metadata +127 -80
- data/lib/steep/project/file_loader.rb +0 -68
- data/lib/steep/project/signature_file.rb +0 -39
- data/lib/steep/project/source_file.rb +0 -129
- data/lib/steep/project/stats_calculator.rb +0 -80
- data/lib/steep/server/code_worker.rb +0 -150
- data/lib/steep/server/signature_worker.rb +0 -157
- data/lib/steep/server/utils.rb +0 -69
- data/smoke/alias/test.yaml +0 -73
- data/smoke/and/test.yaml +0 -24
- data/smoke/array/test.yaml +0 -80
- data/smoke/block/test.yaml +0 -96
- data/smoke/broken/broken.rb +0 -0
- data/smoke/broken/broken.rbs +0 -0
- data/smoke/broken/test.yaml +0 -6
- data/smoke/case/test.yaml +0 -36
- data/smoke/class/test.yaml +0 -89
- data/smoke/const/test.yaml +0 -96
- data/smoke/diagnostics-rbs-duplicated/test.yaml +0 -10
- data/smoke/diagnostics-rbs/test.yaml +0 -142
- data/smoke/diagnostics/test.yaml +0 -333
- data/smoke/dstr/test.yaml +0 -10
- data/smoke/ensure/test.yaml +0 -47
- data/smoke/enumerator/test.yaml +0 -100
- data/smoke/extension/test.yaml +0 -50
- data/smoke/hash/test.yaml +0 -62
- data/smoke/hello/test.yaml +0 -18
- data/smoke/if/test.yaml +0 -27
- data/smoke/implements/test.yaml +0 -16
- data/smoke/initialize/test.yaml +0 -4
- data/smoke/integer/test.yaml +0 -66
- data/smoke/interface/test.yaml +0 -16
- data/smoke/kwbegin/test.yaml +0 -14
- data/smoke/lambda/test.yaml +0 -28
- data/smoke/literal/test.yaml +0 -79
- data/smoke/map/test.yaml +0 -4
- data/smoke/method/test.yaml +0 -71
- data/smoke/module/test.yaml +0 -51
- data/smoke/regexp/test.yaml +0 -372
- data/smoke/regression/test.yaml +0 -38
- data/smoke/rescue/test.yaml +0 -60
- data/smoke/self/test.yaml +0 -16
- data/smoke/skip/test.yaml +0 -16
- data/smoke/stdout/test.yaml +0 -4
- data/smoke/super/test.yaml +0 -52
- data/smoke/toplevel/test.yaml +0 -12
- data/smoke/tsort/test.yaml +0 -32
- data/smoke/type_case/test.yaml +0 -33
- data/smoke/yield/test.yaml +0 -49
@@ -0,0 +1,231 @@
|
|
1
|
+
---
|
2
|
+
- file: duplicated-method-definition.rbs
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 2
|
7
|
+
character: 2
|
8
|
+
end:
|
9
|
+
line: 2
|
10
|
+
character: 21
|
11
|
+
severity: ERROR
|
12
|
+
message: Non-overloading method definition of `foo` in `::DuplicatedMethodDefinitionError`
|
13
|
+
cannot be duplicated
|
14
|
+
code: RBS::DuplicatedMethodDefinition
|
15
|
+
- range:
|
16
|
+
start:
|
17
|
+
line: 6
|
18
|
+
character: 4
|
19
|
+
end:
|
20
|
+
line: 6
|
21
|
+
character: 21
|
22
|
+
severity: ERROR
|
23
|
+
message: Non-overloading method definition of `f` in `::DuplicatedMethodDefinitionError::_Hello`
|
24
|
+
cannot be duplicated
|
25
|
+
code: RBS::DuplicatedMethodDefinition
|
26
|
+
- range:
|
27
|
+
start:
|
28
|
+
line: 18
|
29
|
+
character: 4
|
30
|
+
end:
|
31
|
+
line: 18
|
32
|
+
character: 23
|
33
|
+
severity: ERROR
|
34
|
+
message: Non-overloading method definition of `g` in `::DuplicatedMethodDefinitionError::A`
|
35
|
+
cannot be duplicated
|
36
|
+
code: RBS::DuplicatedMethodDefinition
|
37
|
+
- file: generic-parameter-mismatch.rbs
|
38
|
+
diagnostics:
|
39
|
+
- range:
|
40
|
+
start:
|
41
|
+
line: 5
|
42
|
+
character: 2
|
43
|
+
end:
|
44
|
+
line: 6
|
45
|
+
character: 5
|
46
|
+
severity: ERROR
|
47
|
+
message: Different generic parameters are specified across definitions of `::GenericParameterMismatchError::Foo`
|
48
|
+
code: RBS::GenericParameterMismatch
|
49
|
+
- file: invalid-method-overload.rbs
|
50
|
+
diagnostics:
|
51
|
+
- range:
|
52
|
+
start:
|
53
|
+
line: 2
|
54
|
+
character: 2
|
55
|
+
end:
|
56
|
+
line: 2
|
57
|
+
character: 27
|
58
|
+
severity: ERROR
|
59
|
+
message: Cannot find a non-overloading definition of `foo` in `::InvalidMethodOverload`
|
60
|
+
code: RBS::InvalidMethodOverload
|
61
|
+
- file: invalid-type-application.rbs
|
62
|
+
diagnostics:
|
63
|
+
- range:
|
64
|
+
start:
|
65
|
+
line: 2
|
66
|
+
character: 13
|
67
|
+
end:
|
68
|
+
line: 2
|
69
|
+
character: 23
|
70
|
+
severity: ERROR
|
71
|
+
message: Type `::Integer` is not generic but used as a generic type with 1 arguments
|
72
|
+
code: RBS::InvalidTypeApplication
|
73
|
+
- range:
|
74
|
+
start:
|
75
|
+
line: 4
|
76
|
+
character: 13
|
77
|
+
end:
|
78
|
+
line: 4
|
79
|
+
character: 24
|
80
|
+
severity: ERROR
|
81
|
+
message: Type `::Array` expects 1 arguments, but 2 arguments are given
|
82
|
+
code: RBS::InvalidTypeApplication
|
83
|
+
- range:
|
84
|
+
start:
|
85
|
+
line: 6
|
86
|
+
character: 13
|
87
|
+
end:
|
88
|
+
line: 6
|
89
|
+
character: 17
|
90
|
+
severity: ERROR
|
91
|
+
message: Type `::Hash` is generic but used as a non generic type
|
92
|
+
code: RBS::InvalidTypeApplication
|
93
|
+
- file: invalid_variance_annotation.rbs
|
94
|
+
diagnostics:
|
95
|
+
- range:
|
96
|
+
start:
|
97
|
+
line: 2
|
98
|
+
character: 11
|
99
|
+
end:
|
100
|
+
line: 2
|
101
|
+
character: 22
|
102
|
+
severity: ERROR
|
103
|
+
message: The variance of type parameter `A` is covariant, but used in incompatible
|
104
|
+
position here
|
105
|
+
code: RBS::InvalidVarianceAnnotation
|
106
|
+
- file: recursive-alias.rbs
|
107
|
+
diagnostics:
|
108
|
+
- range:
|
109
|
+
start:
|
110
|
+
line: 2
|
111
|
+
character: 2
|
112
|
+
end:
|
113
|
+
line: 2
|
114
|
+
character: 15
|
115
|
+
severity: ERROR
|
116
|
+
message: 'Circular method alias is detected in `::RecursiveAlias`: foo -> bar
|
117
|
+
-> baz'
|
118
|
+
code: RBS::RecursiveAlias
|
119
|
+
- file: recursive-class.rbs
|
120
|
+
diagnostics:
|
121
|
+
- range:
|
122
|
+
start:
|
123
|
+
line: 1
|
124
|
+
character: 0
|
125
|
+
end:
|
126
|
+
line: 2
|
127
|
+
character: 3
|
128
|
+
severity: ERROR
|
129
|
+
message: 'Circular inheritance/mix-in is detected: ::Foo <: ::Bar <: ::Baz <:
|
130
|
+
::Foo'
|
131
|
+
code: RBS::RecursiveAncestor
|
132
|
+
- range:
|
133
|
+
start:
|
134
|
+
line: 4
|
135
|
+
character: 0
|
136
|
+
end:
|
137
|
+
line: 5
|
138
|
+
character: 3
|
139
|
+
severity: ERROR
|
140
|
+
message: 'Circular inheritance/mix-in is detected: ::Bar <: ::Baz <: ::Foo <:
|
141
|
+
::Bar'
|
142
|
+
code: RBS::RecursiveAncestor
|
143
|
+
- range:
|
144
|
+
start:
|
145
|
+
line: 7
|
146
|
+
character: 0
|
147
|
+
end:
|
148
|
+
line: 8
|
149
|
+
character: 3
|
150
|
+
severity: ERROR
|
151
|
+
message: 'Circular inheritance/mix-in is detected: ::Baz <: ::Foo <: ::Bar <:
|
152
|
+
::Baz'
|
153
|
+
code: RBS::RecursiveAncestor
|
154
|
+
- file: superclass-mismatch.rbs
|
155
|
+
diagnostics:
|
156
|
+
- range:
|
157
|
+
start:
|
158
|
+
line: 2
|
159
|
+
character: 2
|
160
|
+
end:
|
161
|
+
line: 3
|
162
|
+
character: 5
|
163
|
+
severity: ERROR
|
164
|
+
message: Different superclasses are specified for `::SuperclassMismatch::Foo`
|
165
|
+
code: RBS::SuperclassMismatch
|
166
|
+
- file: unknown-method-alias.rbs
|
167
|
+
diagnostics:
|
168
|
+
- range:
|
169
|
+
start:
|
170
|
+
line: 2
|
171
|
+
character: 2
|
172
|
+
end:
|
173
|
+
line: 2
|
174
|
+
character: 15
|
175
|
+
severity: ERROR
|
176
|
+
message: Cannot find the original method `bar` in `::UnknownMethodAlias`
|
177
|
+
code: RBS::UnknownMethodAlias
|
178
|
+
- file: unknown-type-name-2.rbs
|
179
|
+
diagnostics:
|
180
|
+
- range:
|
181
|
+
start:
|
182
|
+
line: 2
|
183
|
+
character: 13
|
184
|
+
end:
|
185
|
+
line: 2
|
186
|
+
character: 16
|
187
|
+
severity: ERROR
|
188
|
+
message: Cannot find type `::bar`
|
189
|
+
code: RBS::UnknownTypeName
|
190
|
+
- range:
|
191
|
+
start:
|
192
|
+
line: 4
|
193
|
+
character: 9
|
194
|
+
end:
|
195
|
+
line: 4
|
196
|
+
character: 14
|
197
|
+
severity: ERROR
|
198
|
+
message: Cannot find type `::World`
|
199
|
+
code: RBS::UnknownTypeName
|
200
|
+
- file: unknown-type-name.rbs
|
201
|
+
diagnostics:
|
202
|
+
- range:
|
203
|
+
start:
|
204
|
+
line: 6
|
205
|
+
character: 2
|
206
|
+
end:
|
207
|
+
line: 6
|
208
|
+
character: 15
|
209
|
+
severity: ERROR
|
210
|
+
message: Cannot find type `World`
|
211
|
+
code: RBS::UnknownTypeName
|
212
|
+
- range:
|
213
|
+
start:
|
214
|
+
line: 8
|
215
|
+
character: 2
|
216
|
+
end:
|
217
|
+
line: 9
|
218
|
+
character: 5
|
219
|
+
severity: ERROR
|
220
|
+
message: Cannot find type `ABC`
|
221
|
+
code: RBS::UnknownTypeName
|
222
|
+
- range:
|
223
|
+
start:
|
224
|
+
line: 11
|
225
|
+
character: 15
|
226
|
+
end:
|
227
|
+
line: 11
|
228
|
+
character: 18
|
229
|
+
severity: ERROR
|
230
|
+
message: Cannot find type `ZZZ`
|
231
|
+
code: RBS::UnknownTypeName
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
- file: unsatisfiable_constraint.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 3
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 6
|
10
|
+
character: 3
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Unsatisfiable constraint `::Array[untyped] <: A(2) <: ::String` is generated through (A(2)) { (A(2)) -> void } -> B(3)
|
14
|
+
::Array[untyped] <: ::String
|
15
|
+
::Object <: ::String
|
16
|
+
::BasicObject <: ::String
|
17
|
+
code: Ruby::UnsatisfiableConstraint
|
18
|
+
- range:
|
19
|
+
start:
|
20
|
+
line: 5
|
21
|
+
character: 4
|
22
|
+
end:
|
23
|
+
line: 5
|
24
|
+
character: 7
|
25
|
+
severity: ERROR
|
26
|
+
message: Type `::String` does not have method `foo`
|
27
|
+
code: Ruby::NoMethod
|
data/smoke/diagnostics/a.rbs
CHANGED
@@ -0,0 +1,451 @@
|
|
1
|
+
---
|
2
|
+
- file: argument_type_mismatch.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 1
|
7
|
+
character: 9
|
8
|
+
end:
|
9
|
+
line: 1
|
10
|
+
character: 11
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot pass a value of type `::String` as an argument of type `::int`
|
14
|
+
::String <: ::int
|
15
|
+
::String <: (::Integer | ::_ToInt)
|
16
|
+
::String <: ::Integer
|
17
|
+
::Object <: ::Integer
|
18
|
+
::BasicObject <: ::Integer
|
19
|
+
code: Ruby::ArgumentTypeMismatch
|
20
|
+
- file: block_body_type_mismatch.rb
|
21
|
+
diagnostics:
|
22
|
+
- range:
|
23
|
+
start:
|
24
|
+
line: 1
|
25
|
+
character: 30
|
26
|
+
end:
|
27
|
+
line: 1
|
28
|
+
character: 36
|
29
|
+
severity: ERROR
|
30
|
+
message: |-
|
31
|
+
Cannot allow block body have type `::String` because declared as type `::Integer`
|
32
|
+
::String <: ::Integer
|
33
|
+
::Object <: ::Integer
|
34
|
+
::BasicObject <: ::Integer
|
35
|
+
code: Ruby::BlockBodyTypeMismatch
|
36
|
+
- file: block_type_mismatch.rb
|
37
|
+
diagnostics:
|
38
|
+
- range:
|
39
|
+
start:
|
40
|
+
line: 3
|
41
|
+
character: 8
|
42
|
+
end:
|
43
|
+
line: 3
|
44
|
+
character: 12
|
45
|
+
severity: ERROR
|
46
|
+
message: |-
|
47
|
+
Cannot pass a value of type `^(untyped, untyped, untyped) -> untyped` as a block-pass-argument of type `^(::Integer) -> void`
|
48
|
+
^(untyped, untyped, untyped) -> untyped <: ^(::Integer) -> void
|
49
|
+
code: Ruby::BlockTypeMismatch
|
50
|
+
- file: break_type_mismatch.rb
|
51
|
+
diagnostics:
|
52
|
+
- range:
|
53
|
+
start:
|
54
|
+
line: 1
|
55
|
+
character: 10
|
56
|
+
end:
|
57
|
+
line: 1
|
58
|
+
character: 18
|
59
|
+
severity: ERROR
|
60
|
+
message: |-
|
61
|
+
Cannot break with a value of type `::String` because type `::Integer` is assumed
|
62
|
+
::String <: ::Integer
|
63
|
+
::Object <: ::Integer
|
64
|
+
::BasicObject <: ::Integer
|
65
|
+
code: Ruby::BreakTypeMismatch
|
66
|
+
- file: else_on_exhaustive_case.rb
|
67
|
+
diagnostics:
|
68
|
+
- range:
|
69
|
+
start:
|
70
|
+
line: 11
|
71
|
+
character: 2
|
72
|
+
end:
|
73
|
+
line: 11
|
74
|
+
character: 26
|
75
|
+
severity: ERROR
|
76
|
+
message: The branch is unreachable because the condition is exhaustive
|
77
|
+
code: Ruby::ElseOnExhaustiveCase
|
78
|
+
- file: incompatible_annotation.rb
|
79
|
+
diagnostics:
|
80
|
+
- range:
|
81
|
+
start:
|
82
|
+
line: 5
|
83
|
+
character: 2
|
84
|
+
end:
|
85
|
+
line: 5
|
86
|
+
character: 8
|
87
|
+
severity: ERROR
|
88
|
+
message: |-
|
89
|
+
Type annotation about `a` is incompatible since ::String <: ::Array[::Integer] doesn't hold
|
90
|
+
::String <: ::Array[::Integer]
|
91
|
+
::Object <: ::Array[::Integer]
|
92
|
+
::BasicObject <: ::Array[::Integer]
|
93
|
+
code: Ruby::IncompatibleAnnotation
|
94
|
+
- file: incompatible_argument.rb
|
95
|
+
diagnostics:
|
96
|
+
- range:
|
97
|
+
start:
|
98
|
+
line: 1
|
99
|
+
character: 6
|
100
|
+
end:
|
101
|
+
line: 1
|
102
|
+
character: 8
|
103
|
+
severity: ERROR
|
104
|
+
message: |-
|
105
|
+
Cannot find method `at` of type `::Array[::Integer]` with compatible arity
|
106
|
+
Method types:
|
107
|
+
def at: (::int) -> (::Integer | nil)
|
108
|
+
code: Ruby::IncompatibleArguments
|
109
|
+
- file: incompatible_assignment.rb
|
110
|
+
diagnostics:
|
111
|
+
- range:
|
112
|
+
start:
|
113
|
+
line: 2
|
114
|
+
character: 0
|
115
|
+
end:
|
116
|
+
line: 2
|
117
|
+
character: 5
|
118
|
+
severity: ERROR
|
119
|
+
message: |-
|
120
|
+
Cannot assign a value of type `::Integer` to a variable of type `::String`
|
121
|
+
::Integer <: ::String
|
122
|
+
::Numeric <: ::String
|
123
|
+
::Object <: ::String
|
124
|
+
::BasicObject <: ::String
|
125
|
+
code: Ruby::IncompatibleAssignment
|
126
|
+
- range:
|
127
|
+
start:
|
128
|
+
line: 5
|
129
|
+
character: 0
|
130
|
+
end:
|
131
|
+
line: 5
|
132
|
+
character: 7
|
133
|
+
severity: ERROR
|
134
|
+
message: |-
|
135
|
+
Cannot assign a value of type `::Integer` to a constant of type `::String`
|
136
|
+
::Integer <: ::String
|
137
|
+
::Numeric <: ::String
|
138
|
+
::Object <: ::String
|
139
|
+
::BasicObject <: ::String
|
140
|
+
code: Ruby::IncompatibleAssignment
|
141
|
+
- range:
|
142
|
+
start:
|
143
|
+
line: 8
|
144
|
+
character: 0
|
145
|
+
end:
|
146
|
+
line: 8
|
147
|
+
character: 9
|
148
|
+
severity: ERROR
|
149
|
+
message: |-
|
150
|
+
Cannot assign a value of type `::Symbol` to a variable of type `::Integer`
|
151
|
+
::Symbol <: ::Integer
|
152
|
+
::Object <: ::Integer
|
153
|
+
::BasicObject <: ::Integer
|
154
|
+
code: Ruby::IncompatibleAssignment
|
155
|
+
- file: method_arity_mismatch.rb
|
156
|
+
diagnostics:
|
157
|
+
- range:
|
158
|
+
start:
|
159
|
+
line: 3
|
160
|
+
character: 9
|
161
|
+
end:
|
162
|
+
line: 3
|
163
|
+
character: 12
|
164
|
+
severity: ERROR
|
165
|
+
message: Method parameters are incompatible with declaration `() -> void`
|
166
|
+
code: Ruby::MethodArityMismatch
|
167
|
+
- range:
|
168
|
+
start:
|
169
|
+
line: 8
|
170
|
+
character: 11
|
171
|
+
end:
|
172
|
+
line: 8
|
173
|
+
character: 14
|
174
|
+
severity: ERROR
|
175
|
+
message: Method parameters are incompatible with declaration `(::String) -> void`
|
176
|
+
code: Ruby::MethodArityMismatch
|
177
|
+
- file: method_body_type_mismatch.rb
|
178
|
+
diagnostics:
|
179
|
+
- range:
|
180
|
+
start:
|
181
|
+
line: 3
|
182
|
+
character: 2
|
183
|
+
end:
|
184
|
+
line: 5
|
185
|
+
character: 5
|
186
|
+
severity: ERROR
|
187
|
+
message: |-
|
188
|
+
Cannot allow method body have type `::String` because declared as type `::Integer`
|
189
|
+
::String <: ::Integer
|
190
|
+
::Object <: ::Integer
|
191
|
+
::BasicObject <: ::Integer
|
192
|
+
code: Ruby::MethodBodyTypeMismatch
|
193
|
+
- file: method_definition_missing.rb
|
194
|
+
diagnostics:
|
195
|
+
- range:
|
196
|
+
start:
|
197
|
+
line: 1
|
198
|
+
character: 6
|
199
|
+
end:
|
200
|
+
line: 1
|
201
|
+
character: 29
|
202
|
+
severity: ERROR
|
203
|
+
message: Cannot find implementation of method `::MethodDefinitionMissing#foo`
|
204
|
+
code: Ruby::MethodDefinitionMissing
|
205
|
+
- file: method_return_type_annotation_mismatch.rb
|
206
|
+
diagnostics:
|
207
|
+
- range:
|
208
|
+
start:
|
209
|
+
line: 3
|
210
|
+
character: 2
|
211
|
+
end:
|
212
|
+
line: 6
|
213
|
+
character: 5
|
214
|
+
severity: ERROR
|
215
|
+
message: |-
|
216
|
+
Annotation `@type return` specifies type `::Integer` where declared as type `::String`
|
217
|
+
::Integer <: ::String
|
218
|
+
::Numeric <: ::String
|
219
|
+
::Object <: ::String
|
220
|
+
::BasicObject <: ::String
|
221
|
+
code: Ruby::MethodReturnTypeAnnotationMismatch
|
222
|
+
- file: missing_keyword.rb
|
223
|
+
diagnostics:
|
224
|
+
- range:
|
225
|
+
start:
|
226
|
+
line: 1
|
227
|
+
character: 23
|
228
|
+
end:
|
229
|
+
line: 1
|
230
|
+
character: 32
|
231
|
+
severity: ERROR
|
232
|
+
message: 'Cannot omit required keywords: `foo`'
|
233
|
+
code: Ruby::MissingKeyword
|
234
|
+
- file: no_method.rb
|
235
|
+
diagnostics:
|
236
|
+
- range:
|
237
|
+
start:
|
238
|
+
line: 1
|
239
|
+
character: 2
|
240
|
+
end:
|
241
|
+
line: 1
|
242
|
+
character: 5
|
243
|
+
severity: ERROR
|
244
|
+
message: Type `::Integer` does not have method `foo`
|
245
|
+
code: Ruby::NoMethod
|
246
|
+
- file: required_block_missing.rb
|
247
|
+
diagnostics:
|
248
|
+
- range:
|
249
|
+
start:
|
250
|
+
line: 1
|
251
|
+
character: 4
|
252
|
+
end:
|
253
|
+
line: 1
|
254
|
+
character: 7
|
255
|
+
severity: ERROR
|
256
|
+
message: The method cannot be called without a block
|
257
|
+
code: Ruby::RequiredBlockMissing
|
258
|
+
- file: return_type_mismatch.rb
|
259
|
+
diagnostics:
|
260
|
+
- range:
|
261
|
+
start:
|
262
|
+
line: 4
|
263
|
+
character: 4
|
264
|
+
end:
|
265
|
+
line: 4
|
266
|
+
character: 13
|
267
|
+
severity: ERROR
|
268
|
+
message: |-
|
269
|
+
The method cannot return a value of type `::Integer` because declared as type `::String`
|
270
|
+
::Integer <: ::String
|
271
|
+
::Numeric <: ::String
|
272
|
+
::Object <: ::String
|
273
|
+
::BasicObject <: ::String
|
274
|
+
code: Ruby::ReturnTypeMismatch
|
275
|
+
- file: unexpected_block_given.rb
|
276
|
+
diagnostics:
|
277
|
+
- range:
|
278
|
+
start:
|
279
|
+
line: 1
|
280
|
+
character: 10
|
281
|
+
end:
|
282
|
+
line: 1
|
283
|
+
character: 17
|
284
|
+
severity: ERROR
|
285
|
+
message: The method cannot be called with a block
|
286
|
+
code: Ruby::UnexpectedBlockGiven
|
287
|
+
- file: unexpected_dynamic_method.rb
|
288
|
+
diagnostics:
|
289
|
+
- range:
|
290
|
+
start:
|
291
|
+
line: 1
|
292
|
+
character: 6
|
293
|
+
end:
|
294
|
+
line: 1
|
295
|
+
character: 29
|
296
|
+
severity: ERROR
|
297
|
+
message: "@dynamic annotation contains unknown method name `foo`"
|
298
|
+
code: Ruby::UnexpectedDynamicMethod
|
299
|
+
- file: unexpected_jump.rb
|
300
|
+
diagnostics:
|
301
|
+
- range:
|
302
|
+
start:
|
303
|
+
line: 1
|
304
|
+
character: 0
|
305
|
+
end:
|
306
|
+
line: 1
|
307
|
+
character: 5
|
308
|
+
severity: ERROR
|
309
|
+
message: Cannot jump from here
|
310
|
+
code: Ruby::UnexpectedJump
|
311
|
+
- range:
|
312
|
+
start:
|
313
|
+
line: 3
|
314
|
+
character: 0
|
315
|
+
end:
|
316
|
+
line: 3
|
317
|
+
character: 4
|
318
|
+
severity: ERROR
|
319
|
+
message: Cannot jump from here
|
320
|
+
code: Ruby::UnexpectedJump
|
321
|
+
- file: unexpected_jump_value.rb
|
322
|
+
diagnostics:
|
323
|
+
- range:
|
324
|
+
start:
|
325
|
+
line: 2
|
326
|
+
character: 2
|
327
|
+
end:
|
328
|
+
line: 2
|
329
|
+
character: 10
|
330
|
+
severity: ERROR
|
331
|
+
message: The value given to break will be ignored
|
332
|
+
code: Ruby::UnexpectedJumpValue
|
333
|
+
- file: unexpected_keyword.rb
|
334
|
+
diagnostics:
|
335
|
+
- range:
|
336
|
+
start:
|
337
|
+
line: 1
|
338
|
+
character: 26
|
339
|
+
end:
|
340
|
+
line: 1
|
341
|
+
character: 45
|
342
|
+
severity: ERROR
|
343
|
+
message: 'Cannot specify unexpected keyword arguments: `bar`'
|
344
|
+
code: Ruby::UnexpectedKeyword
|
345
|
+
- file: unexpected_splat.rb
|
346
|
+
diagnostics:
|
347
|
+
- range:
|
348
|
+
start:
|
349
|
+
line: 1
|
350
|
+
character: 13
|
351
|
+
end:
|
352
|
+
line: 1
|
353
|
+
character: 18
|
354
|
+
severity: ERROR
|
355
|
+
message: Hash splat is given with object other than `Hash[X, Y]`
|
356
|
+
code: Ruby::UnexpectedSplat
|
357
|
+
- file: unexpected_yield.rb
|
358
|
+
diagnostics:
|
359
|
+
- range:
|
360
|
+
start:
|
361
|
+
line: 4
|
362
|
+
character: 4
|
363
|
+
end:
|
364
|
+
line: 4
|
365
|
+
character: 9
|
366
|
+
severity: ERROR
|
367
|
+
message: Cannot detect the type of the expression
|
368
|
+
code: Ruby::FallbackAny
|
369
|
+
- range:
|
370
|
+
start:
|
371
|
+
line: 4
|
372
|
+
character: 4
|
373
|
+
end:
|
374
|
+
line: 4
|
375
|
+
character: 9
|
376
|
+
severity: ERROR
|
377
|
+
message: No block given for `yield`
|
378
|
+
code: Ruby::UnexpectedYield
|
379
|
+
- file: unknown_constant_assigned.rb
|
380
|
+
diagnostics:
|
381
|
+
- range:
|
382
|
+
start:
|
383
|
+
line: 2
|
384
|
+
character: 2
|
385
|
+
end:
|
386
|
+
line: 2
|
387
|
+
character: 5
|
388
|
+
severity: ERROR
|
389
|
+
message: Cannot find the declaration of constant `FOO`
|
390
|
+
code: Ruby::UnknownConstantAssigned
|
391
|
+
- range:
|
392
|
+
start:
|
393
|
+
line: 4
|
394
|
+
character: 2
|
395
|
+
end:
|
396
|
+
line: 4
|
397
|
+
character: 5
|
398
|
+
severity: ERROR
|
399
|
+
message: Cannot detect the type of the expression
|
400
|
+
code: Ruby::FallbackAny
|
401
|
+
- range:
|
402
|
+
start:
|
403
|
+
line: 4
|
404
|
+
character: 2
|
405
|
+
end:
|
406
|
+
line: 4
|
407
|
+
character: 10
|
408
|
+
severity: ERROR
|
409
|
+
message: Cannot find the declaration of constant `FOO::BAR`
|
410
|
+
code: Ruby::UnknownConstantAssigned
|
411
|
+
- range:
|
412
|
+
start:
|
413
|
+
line: 6
|
414
|
+
character: 2
|
415
|
+
end:
|
416
|
+
line: 6
|
417
|
+
character: 7
|
418
|
+
severity: ERROR
|
419
|
+
message: Cannot find the declaration of constant `::FOO`
|
420
|
+
code: Ruby::UnknownConstantAssigned
|
421
|
+
- file: unresolved_overloading.rb
|
422
|
+
diagnostics:
|
423
|
+
- range:
|
424
|
+
start:
|
425
|
+
line: 1
|
426
|
+
character: 0
|
427
|
+
end:
|
428
|
+
line: 1
|
429
|
+
character: 6
|
430
|
+
severity: ERROR
|
431
|
+
message: |-
|
432
|
+
Cannot find compatible overloading of method `+` of type `::Integer`
|
433
|
+
Method types:
|
434
|
+
def +: (::Integer) -> ::Integer
|
435
|
+
| (::Float) -> ::Float
|
436
|
+
| (::Rational) -> ::Rational
|
437
|
+
| (::Complex) -> ::Complex
|
438
|
+
code: Ruby::UnresolvedOverloading
|
439
|
+
- file: unsupported_syntax.rb
|
440
|
+
diagnostics:
|
441
|
+
- range:
|
442
|
+
start:
|
443
|
+
line: 1
|
444
|
+
character: 0
|
445
|
+
end:
|
446
|
+
line: 2
|
447
|
+
character: 3
|
448
|
+
severity: ERROR
|
449
|
+
message: sclass receiver must be instance type or singleton type, but type given
|
450
|
+
`(::Integer | ::String | nil)`
|
451
|
+
code: Ruby::UnsupportedSyntax
|