steep 1.0.0 → 1.1.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby-windows.yml +34 -0
- data/.github/workflows/ruby.yml +7 -2
- data/.gitignore +1 -0
- data/CHANGELOG.md +59 -0
- data/Gemfile +7 -4
- data/Gemfile.lock +17 -21
- data/Gemfile.steep +3 -0
- data/Gemfile.steep.lock +49 -0
- data/Rakefile +5 -0
- data/Steepfile +6 -1
- data/bin/setup +2 -0
- data/bin/steep +19 -0
- data/lib/steep/ast/builtin.rb +2 -2
- data/lib/steep/ast/types/factory.rb +7 -3
- data/lib/steep/ast/types/proc.rb +2 -0
- data/lib/steep/cli.rb +3 -1
- data/lib/steep/diagnostic/ruby.rb +50 -4
- data/lib/steep/diagnostic/signature.rb +18 -0
- data/lib/steep/drivers/check.rb +3 -3
- data/lib/steep/drivers/watch.rb +3 -1
- data/lib/steep/method_name.rb +9 -3
- data/lib/steep/node_helper.rb +49 -0
- data/lib/steep/path_helper.rb +22 -0
- data/lib/steep/project.rb +3 -15
- data/lib/steep/server/base_worker.rb +1 -0
- data/lib/steep/server/change_buffer.rb +1 -1
- data/lib/steep/server/interaction_worker.rb +3 -5
- data/lib/steep/server/master.rb +61 -45
- data/lib/steep/server/type_check_worker.rb +10 -25
- data/lib/steep/services/completion_provider.rb +25 -18
- data/lib/steep/services/goto_service.rb +2 -4
- data/lib/steep/services/hover_provider/rbs.rb +1 -1
- data/lib/steep/services/hover_provider/ruby.rb +30 -12
- data/lib/steep/services/stats_calculator.rb +0 -1
- data/lib/steep/services/type_check_service.rb +15 -12
- data/lib/steep/shims/symbol_start_with.rb +18 -0
- data/lib/steep/signature/validator.rb +25 -1
- data/lib/steep/source.rb +1 -1
- data/lib/steep/subtyping/check.rb +0 -3
- data/lib/steep/subtyping/constraints.rb +43 -14
- data/lib/steep/type_construction.rb +721 -764
- data/lib/steep/type_inference/constant_env.rb +0 -2
- data/lib/steep/type_inference/context.rb +23 -17
- data/lib/steep/type_inference/logic_type_interpreter.rb +210 -117
- data/lib/steep/type_inference/method_call.rb +80 -6
- data/lib/steep/type_inference/multiple_assignment.rb +189 -0
- data/lib/steep/type_inference/send_args.rb +1 -2
- data/lib/steep/type_inference/type_env.rb +273 -116
- data/lib/steep/type_inference/type_env_builder.rb +138 -0
- data/lib/steep/typing.rb +2 -0
- data/lib/steep/version.rb +1 -1
- data/lib/steep.rb +7 -5
- data/rbs_collection.steep.lock.yaml +112 -0
- data/rbs_collection.steep.yaml +19 -0
- data/sample/sig/conference.rbs +8 -0
- data/sig/shims/parser/source/map.rbs +146 -0
- data/sig/shims/parser/source/range.rbs +237 -0
- data/sig/shims/parser.rbs +17 -0
- data/sig/steep/ast/annotation/collection.rbs +75 -0
- data/sig/steep/ast/annotation.rbs +126 -0
- data/sig/steep/ast/builtin.rbs +69 -0
- data/sig/steep/ast/type_params.rbs +11 -0
- data/sig/steep/ast/types/any.rbs +29 -0
- data/sig/steep/ast/types/boolean.rbs +31 -0
- data/sig/steep/ast/types/bot.rbs +29 -0
- data/sig/steep/ast/types/class.rbs +29 -0
- data/sig/steep/ast/types/factory.rbs +76 -0
- data/sig/steep/ast/types/helper.rbs +19 -0
- data/sig/steep/ast/types/instance.rbs +29 -0
- data/sig/steep/ast/types/intersection.rbs +35 -0
- data/sig/steep/ast/types/literal.rbs +33 -0
- data/sig/steep/ast/types/logic.rbs +78 -0
- data/sig/steep/ast/types/name.rbs +71 -0
- data/sig/steep/ast/types/nil.rbs +31 -0
- data/sig/steep/ast/types/proc.rbs +46 -0
- data/sig/steep/ast/types/record.rbs +38 -0
- data/sig/steep/ast/types/self.rbs +29 -0
- data/sig/steep/ast/types/top.rbs +29 -0
- data/sig/steep/ast/types/tuple.rbs +34 -0
- data/sig/steep/ast/types/union.rbs +38 -0
- data/sig/steep/ast/types/var.rbs +37 -0
- data/sig/steep/ast/types/void.rbs +29 -0
- data/sig/steep/ast/types.rbs +37 -0
- data/sig/steep/diagnostic/deprecated/unknown_constant_assigned.rbs +15 -0
- data/sig/steep/diagnostic/helper.rbs +9 -0
- data/sig/steep/diagnostic/lsp_formatter.rbs +29 -0
- data/sig/steep/diagnostic/ruby.rbs +494 -0
- data/sig/steep/diagnostic/signature.rbs +215 -0
- data/sig/steep/interface/block.rbs +35 -0
- data/sig/steep/interface/function.rbs +253 -0
- data/sig/steep/interface/interface.rbs +23 -0
- data/sig/steep/interface/method_type.rbs +55 -0
- data/sig/steep/interface/substitution.rbs +53 -0
- data/sig/steep/interface/type_param.rbs +35 -0
- data/sig/steep/method_name.rbs +26 -0
- data/sig/steep/module_helper.rbs +7 -0
- data/sig/steep/node_helper.rbs +11 -0
- data/sig/steep/project/dsl.rbs +94 -0
- data/sig/steep/project/options.rbs +15 -0
- data/sig/steep/project/pattern.rbs +25 -0
- data/sig/steep/project/target.rbs +25 -0
- data/sig/steep/project.rbs +19 -0
- data/sig/steep/services/completion_provider.rbs +123 -0
- data/sig/steep/services/content_change.rbs +35 -0
- data/sig/steep/services/file_loader.rbs +13 -0
- data/sig/steep/services/goto_service.rbs +45 -0
- data/sig/steep/services/hover_provider/rbs.rbs +21 -0
- data/sig/steep/services/hover_provider/ruby.rbs +109 -0
- data/sig/steep/services/hover_provider/singleton_methods.rbs +11 -0
- data/sig/steep/services/path_assignment.rbs +21 -0
- data/sig/steep/services/signature_service.rbs +91 -0
- data/sig/steep/services/stats_calculator.rbs +17 -0
- data/sig/steep/services/type_check_service.rbs +93 -0
- data/sig/steep/source.rbs +55 -0
- data/sig/steep/subtyping/cache.rbs +17 -0
- data/sig/steep/subtyping/check.rbs +93 -0
- data/sig/steep/subtyping/constraints.rbs +111 -0
- data/sig/steep/subtyping/relation.rbs +51 -0
- data/sig/steep/subtyping/result.rbs +157 -0
- data/sig/steep/subtyping/variable_variance.rbs +23 -0
- data/sig/steep/type_construction.rbs +285 -0
- data/sig/steep/type_inference/block_params.rbs +52 -0
- data/sig/steep/type_inference/constant_env.rbs +27 -0
- data/sig/steep/type_inference/context.rbs +137 -0
- data/sig/steep/type_inference/logic_type_interpreter.rbs +72 -0
- data/sig/steep/type_inference/method_call.rbs +124 -0
- data/sig/steep/type_inference/method_params.rbs +104 -0
- data/sig/steep/type_inference/multiple_assignment.rbs +76 -0
- data/sig/steep/type_inference/type_env.rbs +158 -0
- data/sig/steep/type_inference/type_env_builder.rbs +77 -0
- data/sig/steep/typing.rbs +68 -0
- data/sig/steep.rbs +31 -0
- data/smoke/class/f.rb +1 -0
- data/smoke/class/test_expectations.yml +2 -2
- data/smoke/diagnostics/test_expectations.yml +4 -2
- data/smoke/regression/lambda.rb +3 -0
- data/smoke/regression/test_expectations.yml +12 -0
- data/steep.gemspec +1 -1
- metadata +95 -9
- data/lib/steep/subtyping/variable_occurrence.rb +0 -51
- data/lib/steep/type_inference/local_variable_type_env.rb +0 -249
- data/lib/steep/type_inference/logic.rb +0 -161
@@ -0,0 +1,15 @@
|
|
1
|
+
module Steep
|
2
|
+
module Diagnostic
|
3
|
+
module Ruby
|
4
|
+
class UnknownConstantAssigned < Base
|
5
|
+
attr_reader context: untyped
|
6
|
+
|
7
|
+
attr_reader name: untyped
|
8
|
+
|
9
|
+
def initialize: (node: untyped, context: untyped, name: untyped) -> void
|
10
|
+
|
11
|
+
def header_line: () -> ::String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Steep
|
2
|
+
module Diagnostic
|
3
|
+
class LSPFormatter
|
4
|
+
LSP: untyped
|
5
|
+
|
6
|
+
attr_reader config: untyped
|
7
|
+
|
8
|
+
attr_reader default_severity: untyped
|
9
|
+
|
10
|
+
ERROR: :error
|
11
|
+
|
12
|
+
WARNING: :warning
|
13
|
+
|
14
|
+
INFORMATION: :information
|
15
|
+
|
16
|
+
HINT: :hint
|
17
|
+
|
18
|
+
def initialize: (?::Hash[untyped, untyped] config, ?default_severity: untyped) -> void
|
19
|
+
|
20
|
+
def validate_class: (untyped klass) -> (untyped | nil)
|
21
|
+
|
22
|
+
def validate_severity: (untyped klass, untyped severity) -> untyped
|
23
|
+
|
24
|
+
def format: (untyped diagnostic) -> untyped
|
25
|
+
|
26
|
+
def severity_for: (untyped diagnostic) -> untyped
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,494 @@
|
|
1
|
+
module Steep
|
2
|
+
module Diagnostic
|
3
|
+
module Ruby
|
4
|
+
type location = Parser::Source::Range | Parser::Source::Range
|
5
|
+
|
6
|
+
class Base
|
7
|
+
include Helper
|
8
|
+
|
9
|
+
attr_reader node: Parser::AST::Node?
|
10
|
+
|
11
|
+
attr_reader location: location?
|
12
|
+
|
13
|
+
def initialize: (node: Parser::AST::Node?, ?location: location?) -> void
|
14
|
+
|
15
|
+
def header_line: () -> String
|
16
|
+
|
17
|
+
def detail_lines: () -> String?
|
18
|
+
|
19
|
+
def diagnostic_code: () -> ::String
|
20
|
+
end
|
21
|
+
|
22
|
+
interface _DiagnosticWithResult
|
23
|
+
def result: () -> Subtyping::Result::Base
|
24
|
+
end
|
25
|
+
|
26
|
+
module ResultPrinter : _DiagnosticWithResult
|
27
|
+
def relation_message: (untyped relation) -> untyped
|
28
|
+
|
29
|
+
def detail_lines: () -> untyped
|
30
|
+
end
|
31
|
+
|
32
|
+
class IncompatibleAssignment < Base
|
33
|
+
attr_reader lhs_type: untyped
|
34
|
+
|
35
|
+
attr_reader rhs_type: untyped
|
36
|
+
|
37
|
+
attr_reader result: untyped
|
38
|
+
|
39
|
+
include ResultPrinter
|
40
|
+
|
41
|
+
def initialize: (node: untyped, lhs_type: untyped, rhs_type: untyped, result: untyped) -> void
|
42
|
+
|
43
|
+
def header_line: () -> ::String
|
44
|
+
end
|
45
|
+
|
46
|
+
class UnexpectedPositionalArgument < Base
|
47
|
+
attr_reader node: untyped
|
48
|
+
|
49
|
+
attr_reader method_type: untyped
|
50
|
+
|
51
|
+
attr_reader method_name: untyped
|
52
|
+
|
53
|
+
def initialize: (node: untyped, method_name: untyped, method_type: untyped) -> void
|
54
|
+
|
55
|
+
def header_line: () -> "Unexpected positional argument"
|
56
|
+
end
|
57
|
+
|
58
|
+
class InsufficientPositionalArguments < Base
|
59
|
+
attr_reader node: untyped
|
60
|
+
|
61
|
+
attr_reader method_name: untyped
|
62
|
+
|
63
|
+
attr_reader method_type: untyped
|
64
|
+
|
65
|
+
def initialize: (node: untyped, method_name: untyped, method_type: untyped) -> void
|
66
|
+
|
67
|
+
def header_line: () -> "More positional arguments are required"
|
68
|
+
end
|
69
|
+
|
70
|
+
class UnexpectedKeywordArgument < Base
|
71
|
+
attr_reader node: untyped
|
72
|
+
|
73
|
+
attr_reader method_name: untyped
|
74
|
+
|
75
|
+
attr_reader method_type: untyped
|
76
|
+
|
77
|
+
def initialize: (node: untyped, method_name: untyped, method_type: untyped) -> void
|
78
|
+
|
79
|
+
def header_line: () -> "Unexpected keyword argument"
|
80
|
+
end
|
81
|
+
|
82
|
+
class InsufficientKeywordArguments < Base
|
83
|
+
attr_reader node: untyped
|
84
|
+
|
85
|
+
attr_reader method_name: untyped
|
86
|
+
|
87
|
+
attr_reader method_type: untyped
|
88
|
+
|
89
|
+
attr_reader missing_keywords: untyped
|
90
|
+
|
91
|
+
def initialize: (node: untyped, method_name: untyped, method_type: untyped, missing_keywords: untyped) -> void
|
92
|
+
|
93
|
+
def header_line: () -> ::String
|
94
|
+
end
|
95
|
+
|
96
|
+
class UnresolvedOverloading < Base
|
97
|
+
attr_reader node: untyped
|
98
|
+
|
99
|
+
attr_reader receiver_type: untyped
|
100
|
+
|
101
|
+
attr_reader method_name: untyped
|
102
|
+
|
103
|
+
attr_reader method_types: untyped
|
104
|
+
|
105
|
+
def initialize: (node: untyped, receiver_type: untyped, method_name: untyped, method_types: untyped) -> void
|
106
|
+
|
107
|
+
def header_line: () -> ::String
|
108
|
+
|
109
|
+
def detail_lines: () -> untyped
|
110
|
+
end
|
111
|
+
|
112
|
+
class ArgumentTypeMismatch < Base
|
113
|
+
attr_reader node: untyped
|
114
|
+
|
115
|
+
attr_reader expected: untyped
|
116
|
+
|
117
|
+
attr_reader actual: untyped
|
118
|
+
|
119
|
+
attr_reader receiver_type: untyped
|
120
|
+
|
121
|
+
attr_reader result: untyped
|
122
|
+
|
123
|
+
include ResultPrinter
|
124
|
+
|
125
|
+
def initialize: (node: untyped, receiver_type: untyped, expected: untyped, actual: untyped, result: untyped) -> void
|
126
|
+
|
127
|
+
def header_line: () -> ::String
|
128
|
+
end
|
129
|
+
|
130
|
+
class NoMethod < Base
|
131
|
+
attr_reader type: AST::Types::t
|
132
|
+
|
133
|
+
attr_reader method: Symbol
|
134
|
+
|
135
|
+
def initialize: (node: Parser::AST::Node, type: AST::Types::t, method: Symbol) -> void
|
136
|
+
|
137
|
+
def header_line: () -> ::String
|
138
|
+
end
|
139
|
+
|
140
|
+
class ReturnTypeMismatch < Base
|
141
|
+
attr_reader expected: untyped
|
142
|
+
|
143
|
+
attr_reader actual: untyped
|
144
|
+
|
145
|
+
attr_reader result: untyped
|
146
|
+
|
147
|
+
include ResultPrinter
|
148
|
+
|
149
|
+
def initialize: (node: untyped, expected: untyped, actual: untyped, result: untyped) -> void
|
150
|
+
|
151
|
+
def header_line: () -> ::String
|
152
|
+
end
|
153
|
+
|
154
|
+
class UnexpectedBlockGiven < Base
|
155
|
+
attr_reader method_type: untyped
|
156
|
+
|
157
|
+
def initialize: (node: untyped, method_type: untyped) -> void
|
158
|
+
|
159
|
+
def header_line: () -> "The method cannot be called with a block"
|
160
|
+
end
|
161
|
+
|
162
|
+
class RequiredBlockMissing < Base
|
163
|
+
attr_reader method_type: untyped
|
164
|
+
|
165
|
+
def initialize: (node: untyped, method_type: untyped) -> void
|
166
|
+
|
167
|
+
def header_line: () -> "The method cannot be called without a block"
|
168
|
+
end
|
169
|
+
|
170
|
+
class BlockTypeMismatch < Base
|
171
|
+
attr_reader expected: untyped
|
172
|
+
|
173
|
+
attr_reader actual: untyped
|
174
|
+
|
175
|
+
attr_reader result: untyped
|
176
|
+
|
177
|
+
include ResultPrinter
|
178
|
+
|
179
|
+
def initialize: (node: untyped, expected: untyped, actual: untyped, result: untyped) -> void
|
180
|
+
|
181
|
+
def header_line: () -> ::String
|
182
|
+
end
|
183
|
+
|
184
|
+
class BlockBodyTypeMismatch < Base
|
185
|
+
attr_reader expected: untyped
|
186
|
+
|
187
|
+
attr_reader actual: untyped
|
188
|
+
|
189
|
+
attr_reader result: untyped
|
190
|
+
|
191
|
+
include ResultPrinter
|
192
|
+
|
193
|
+
def initialize: (node: untyped, expected: untyped, actual: untyped, result: untyped) -> void
|
194
|
+
|
195
|
+
def header_line: () -> ::String
|
196
|
+
end
|
197
|
+
|
198
|
+
class BreakTypeMismatch < Base
|
199
|
+
attr_reader expected: untyped
|
200
|
+
|
201
|
+
attr_reader actual: untyped
|
202
|
+
|
203
|
+
attr_reader result: untyped
|
204
|
+
|
205
|
+
include ResultPrinter
|
206
|
+
|
207
|
+
def initialize: (node: untyped, expected: untyped, actual: untyped, result: untyped) -> void
|
208
|
+
|
209
|
+
def header_line: () -> ::String
|
210
|
+
end
|
211
|
+
|
212
|
+
class ImplicitBreakValueMismatch < Base
|
213
|
+
attr_reader jump_type: untyped
|
214
|
+
|
215
|
+
attr_reader result: untyped
|
216
|
+
|
217
|
+
include ResultPrinter
|
218
|
+
|
219
|
+
def initialize: (node: untyped, jump_type: untyped, result: untyped) -> void
|
220
|
+
|
221
|
+
def header_line: () -> ::String
|
222
|
+
end
|
223
|
+
|
224
|
+
class UnexpectedJump < Base
|
225
|
+
def header_line: () -> "Cannot jump from here"
|
226
|
+
end
|
227
|
+
|
228
|
+
class UnexpectedJumpValue < Base
|
229
|
+
def header_line: () -> ::String
|
230
|
+
end
|
231
|
+
|
232
|
+
class MethodArityMismatch < Base
|
233
|
+
attr_reader method_type: untyped
|
234
|
+
|
235
|
+
def initialize: (node: untyped, method_type: untyped) -> void
|
236
|
+
|
237
|
+
def header_line: () -> ::String
|
238
|
+
end
|
239
|
+
|
240
|
+
class MethodParameterMismatch < Base
|
241
|
+
attr_reader method_param: untyped
|
242
|
+
|
243
|
+
attr_reader method_type: untyped
|
244
|
+
|
245
|
+
def initialize: (method_param: untyped, method_type: untyped) -> void
|
246
|
+
|
247
|
+
def header_line: () -> ::String
|
248
|
+
end
|
249
|
+
|
250
|
+
class DifferentMethodParameterKind < Base
|
251
|
+
attr_reader method_param: untyped
|
252
|
+
|
253
|
+
attr_reader method_type: untyped
|
254
|
+
|
255
|
+
def initialize: (method_param: untyped, method_type: untyped) -> void
|
256
|
+
|
257
|
+
def header_line: () -> ::String
|
258
|
+
end
|
259
|
+
|
260
|
+
class IncompatibleMethodTypeAnnotation < Base
|
261
|
+
attr_reader interface_method: untyped
|
262
|
+
|
263
|
+
attr_reader annotation_method: untyped
|
264
|
+
|
265
|
+
attr_reader result: untyped
|
266
|
+
|
267
|
+
include ResultPrinter
|
268
|
+
|
269
|
+
def initialize: (node: untyped, interface_method: untyped, annotation_method: untyped, result: untyped) -> void
|
270
|
+
end
|
271
|
+
|
272
|
+
class MethodReturnTypeAnnotationMismatch < Base
|
273
|
+
attr_reader method_type: untyped
|
274
|
+
|
275
|
+
attr_reader annotation_type: untyped
|
276
|
+
|
277
|
+
attr_reader result: untyped
|
278
|
+
|
279
|
+
include ResultPrinter
|
280
|
+
|
281
|
+
def initialize: (node: untyped, method_type: untyped, annotation_type: untyped, result: untyped) -> void
|
282
|
+
|
283
|
+
def header_line: () -> ::String
|
284
|
+
end
|
285
|
+
|
286
|
+
class MethodBodyTypeMismatch < Base
|
287
|
+
attr_reader expected: untyped
|
288
|
+
|
289
|
+
attr_reader actual: untyped
|
290
|
+
|
291
|
+
attr_reader result: untyped
|
292
|
+
|
293
|
+
include ResultPrinter
|
294
|
+
|
295
|
+
def initialize: (node: untyped, expected: untyped, actual: untyped, result: untyped) -> void
|
296
|
+
|
297
|
+
def header_line: () -> ::String
|
298
|
+
end
|
299
|
+
|
300
|
+
class UnexpectedYield < Base
|
301
|
+
def header_line: () -> "No block given for `yield`"
|
302
|
+
end
|
303
|
+
|
304
|
+
class UnexpectedSuper < Base
|
305
|
+
attr_reader method: untyped
|
306
|
+
|
307
|
+
def initialize: (node: untyped, method: untyped) -> void
|
308
|
+
|
309
|
+
def header_line: () -> ::String
|
310
|
+
end
|
311
|
+
|
312
|
+
class MethodDefinitionMissing < Base
|
313
|
+
attr_reader module_name: untyped
|
314
|
+
|
315
|
+
attr_reader kind: untyped
|
316
|
+
|
317
|
+
attr_reader missing_method: untyped
|
318
|
+
|
319
|
+
def initialize: (node: untyped, module_name: untyped, kind: untyped, missing_method: untyped) -> void
|
320
|
+
|
321
|
+
def header_line: () -> ::String
|
322
|
+
end
|
323
|
+
|
324
|
+
class UnexpectedDynamicMethod < Base
|
325
|
+
attr_reader module_name: untyped
|
326
|
+
|
327
|
+
attr_reader method_name: untyped
|
328
|
+
|
329
|
+
def initialize: (node: untyped, module_name: untyped, method_name: untyped) -> void
|
330
|
+
|
331
|
+
def header_line: () -> ::String
|
332
|
+
end
|
333
|
+
|
334
|
+
class UnknownConstant < Base
|
335
|
+
attr_reader name: untyped
|
336
|
+
|
337
|
+
attr_reader kind: untyped
|
338
|
+
|
339
|
+
def initialize: (node: untyped, name: untyped) -> void
|
340
|
+
|
341
|
+
def class!: () -> self
|
342
|
+
|
343
|
+
def module!: () -> self
|
344
|
+
|
345
|
+
def header_line: () -> ::String
|
346
|
+
end
|
347
|
+
|
348
|
+
class UnknownInstanceVariable < Base
|
349
|
+
attr_reader name: Symbol
|
350
|
+
|
351
|
+
def initialize: (node: Parser::AST::Node, name: Symbol) -> void
|
352
|
+
|
353
|
+
def header_line: () -> ::String
|
354
|
+
end
|
355
|
+
|
356
|
+
class UnknownGlobalVariable < Base
|
357
|
+
attr_reader name: untyped
|
358
|
+
|
359
|
+
def initialize: (node: untyped, name: untyped) -> void
|
360
|
+
|
361
|
+
def header_line: () -> ::String
|
362
|
+
end
|
363
|
+
|
364
|
+
class FallbackAny < Base
|
365
|
+
def initialize: (node: untyped) -> void
|
366
|
+
|
367
|
+
def header_line: () -> "Cannot detect the type of the expression"
|
368
|
+
end
|
369
|
+
|
370
|
+
class UnsatisfiableConstraint < Base
|
371
|
+
attr_reader method_type: untyped
|
372
|
+
|
373
|
+
attr_reader var: untyped
|
374
|
+
|
375
|
+
attr_reader sub_type: untyped
|
376
|
+
|
377
|
+
attr_reader super_type: untyped
|
378
|
+
|
379
|
+
attr_reader result: untyped
|
380
|
+
|
381
|
+
def initialize: (node: untyped, method_type: untyped, var: untyped, sub_type: untyped, super_type: untyped, result: untyped) -> void
|
382
|
+
|
383
|
+
include ResultPrinter
|
384
|
+
|
385
|
+
def header_line: () -> ::String
|
386
|
+
end
|
387
|
+
|
388
|
+
class IncompatibleAnnotation < Base
|
389
|
+
attr_reader result: Subtyping::Result::Base
|
390
|
+
|
391
|
+
attr_reader relation: Subtyping::Relation
|
392
|
+
|
393
|
+
attr_reader var_name: Symbol
|
394
|
+
|
395
|
+
def initialize: (node: Parser::AST::Node, var_name: Symbol, result: Subtyping::Result::Base, relation: Subtyping::Relation) -> void
|
396
|
+
|
397
|
+
include ResultPrinter
|
398
|
+
|
399
|
+
def header_line: () -> ::String
|
400
|
+
end
|
401
|
+
|
402
|
+
class IncompatibleTypeCase < Base
|
403
|
+
attr_reader var_name: untyped
|
404
|
+
|
405
|
+
attr_reader result: untyped
|
406
|
+
|
407
|
+
attr_reader relation: untyped
|
408
|
+
|
409
|
+
def initialize: (node: untyped, var_name: untyped, result: untyped, relation: untyped) -> void
|
410
|
+
|
411
|
+
include ResultPrinter
|
412
|
+
|
413
|
+
def header_line: () -> ::String
|
414
|
+
end
|
415
|
+
|
416
|
+
class ElseOnExhaustiveCase < Base
|
417
|
+
attr_reader type: untyped
|
418
|
+
|
419
|
+
def initialize: (node: untyped, type: untyped) -> void
|
420
|
+
|
421
|
+
def header_line: () -> "The branch is unreachable because the condition is exhaustive"
|
422
|
+
end
|
423
|
+
|
424
|
+
class UnexpectedSplat < Base
|
425
|
+
attr_reader type: untyped
|
426
|
+
|
427
|
+
def initialize: (node: untyped, type: untyped) -> void
|
428
|
+
|
429
|
+
def header_line: () -> "Hash splat is given with object other than `Hash[X, Y]`"
|
430
|
+
end
|
431
|
+
|
432
|
+
class ProcTypeExpected < Base
|
433
|
+
attr_reader type: untyped
|
434
|
+
|
435
|
+
def initialize: (node: untyped, type: untyped) -> void
|
436
|
+
|
437
|
+
def header_line: () -> ::String
|
438
|
+
end
|
439
|
+
|
440
|
+
# The `#to_ary` of RHS of multiple assignment is called, but returns not tuple nor Array.
|
441
|
+
#
|
442
|
+
# ```ruby
|
443
|
+
# a, b = foo()
|
444
|
+
# ^^^^^
|
445
|
+
# ```
|
446
|
+
#
|
447
|
+
class MultipleAssignmentConversionError < Base
|
448
|
+
attr_reader original_type: AST::Types::t
|
449
|
+
|
450
|
+
attr_reader returned_type: AST::Types::t
|
451
|
+
|
452
|
+
def initialize: (node: Parser::AST::Node, original_type: AST::Types::t, returned_type: AST::Types::t) -> void
|
453
|
+
|
454
|
+
def header_line: () -> ::String
|
455
|
+
end
|
456
|
+
|
457
|
+
class UnsupportedSyntax < Base
|
458
|
+
attr_reader message: untyped
|
459
|
+
|
460
|
+
def initialize: (node: untyped, ?message: untyped?) -> void
|
461
|
+
|
462
|
+
def header_line: () -> (untyped | ::String)
|
463
|
+
end
|
464
|
+
|
465
|
+
class UnexpectedError < Base
|
466
|
+
attr_reader message: untyped
|
467
|
+
|
468
|
+
attr_reader error: untyped
|
469
|
+
|
470
|
+
def initialize: (node: untyped, error: untyped) -> void
|
471
|
+
|
472
|
+
def header_line: () -> ::String
|
473
|
+
end
|
474
|
+
|
475
|
+
class SyntaxError < Base
|
476
|
+
attr_reader message: untyped
|
477
|
+
|
478
|
+
def initialize: (message: untyped, location: untyped) -> void
|
479
|
+
|
480
|
+
def header_line: () -> ::String
|
481
|
+
end
|
482
|
+
|
483
|
+
ALL: untyped
|
484
|
+
|
485
|
+
def self.all_error: () -> untyped
|
486
|
+
|
487
|
+
def self.default: () -> untyped
|
488
|
+
|
489
|
+
def self.strict: () -> untyped
|
490
|
+
|
491
|
+
def self.lenient: () -> untyped
|
492
|
+
end
|
493
|
+
end
|
494
|
+
end
|