steep 0.37.0 → 0.42.0
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.yml +1 -1
- data/CHANGELOG.md +34 -0
- data/Rakefile +5 -2
- data/bin/output_rebaseline.rb +34 -0
- data/bin/output_test.rb +53 -0
- data/lib/steep.rb +95 -14
- data/lib/steep/ast/types/bot.rb +1 -1
- data/lib/steep/ast/types/class.rb +4 -0
- data/lib/steep/ast/types/factory.rb +10 -0
- data/lib/steep/ast/types/logic.rb +16 -3
- data/lib/steep/ast/types/top.rb +1 -1
- data/lib/steep/cli.rb +31 -7
- data/lib/steep/diagnostic/helper.rb +17 -0
- data/lib/steep/diagnostic/lsp_formatter.rb +16 -0
- data/lib/steep/diagnostic/ruby.rb +619 -0
- data/lib/steep/diagnostic/signature.rb +357 -0
- data/lib/steep/drivers/annotations.rb +19 -28
- data/lib/steep/drivers/check.rb +182 -60
- data/lib/steep/drivers/diagnostic_printer.rb +99 -0
- data/lib/steep/drivers/langserver.rb +3 -8
- data/lib/steep/drivers/print_project.rb +10 -9
- data/lib/steep/drivers/stats.rb +124 -32
- data/lib/steep/drivers/trace_printer.rb +5 -1
- data/lib/steep/drivers/utils/jobs_count.rb +9 -0
- data/lib/steep/drivers/validate.rb +31 -13
- data/lib/steep/drivers/watch.rb +69 -48
- data/lib/steep/drivers/worker.rb +16 -8
- data/lib/steep/expectations.rb +159 -0
- data/lib/steep/index/rbs_index.rb +334 -0
- data/lib/steep/index/signature_symbol_provider.rb +162 -0
- data/lib/steep/index/source_index.rb +100 -0
- data/lib/steep/project.rb +0 -30
- data/lib/steep/project/dsl.rb +5 -3
- data/lib/steep/project/options.rb +4 -4
- data/lib/steep/project/pattern.rb +56 -0
- data/lib/steep/project/target.rb +9 -214
- data/lib/steep/range_extension.rb +29 -0
- data/lib/steep/server/base_worker.rb +43 -7
- data/lib/steep/server/change_buffer.rb +63 -0
- data/lib/steep/server/interaction_worker.rb +73 -56
- data/lib/steep/server/master.rb +245 -109
- data/lib/steep/server/type_check_worker.rb +122 -0
- data/lib/steep/server/worker_process.rb +17 -15
- data/lib/steep/{project → services}/completion_provider.rb +3 -3
- data/lib/steep/services/content_change.rb +61 -0
- data/lib/steep/services/file_loader.rb +48 -0
- data/lib/steep/{project → services}/hover_content.rb +14 -16
- data/lib/steep/services/path_assignment.rb +29 -0
- data/lib/steep/services/signature_service.rb +369 -0
- data/lib/steep/services/stats_calculator.rb +69 -0
- data/lib/steep/services/type_check_service.rb +342 -0
- data/lib/steep/signature/validator.rb +174 -32
- data/lib/steep/subtyping/check.rb +248 -47
- data/lib/steep/subtyping/constraints.rb +2 -2
- data/lib/steep/type_construction.rb +565 -295
- data/lib/steep/type_inference/constant_env.rb +5 -1
- data/lib/steep/type_inference/local_variable_type_env.rb +26 -12
- data/lib/steep/type_inference/logic_type_interpreter.rb +99 -26
- data/lib/steep/type_inference/type_env.rb +43 -17
- data/lib/steep/typing.rb +8 -2
- data/lib/steep/version.rb +1 -1
- data/smoke/alias/a.rb +0 -3
- data/smoke/alias/b.rb +0 -1
- data/smoke/alias/c.rb +0 -2
- data/smoke/alias/test_expectations.yml +96 -0
- data/smoke/and/a.rb +0 -3
- data/smoke/and/test_expectations.yml +31 -0
- data/smoke/array/a.rb +0 -3
- data/smoke/array/b.rb +0 -2
- data/smoke/array/c.rb +0 -1
- data/smoke/array/test_expectations.yml +103 -0
- data/smoke/block/a.rb +0 -2
- data/smoke/block/b.rb +0 -2
- data/smoke/block/d.rb +0 -4
- data/smoke/block/test_expectations.yml +125 -0
- data/smoke/case/a.rb +0 -3
- data/smoke/case/test_expectations.yml +47 -0
- data/smoke/class/a.rb +0 -3
- data/smoke/class/c.rb +0 -1
- data/smoke/class/f.rb +0 -1
- data/smoke/class/g.rb +0 -2
- data/smoke/class/i.rb +0 -2
- data/smoke/class/test_expectations.yml +120 -0
- data/smoke/const/a.rb +0 -3
- data/smoke/const/b.rb +7 -0
- data/smoke/const/b.rbs +5 -0
- data/smoke/const/test_expectations.yml +139 -0
- data/smoke/diagnostics-rbs-duplicated/Steepfile +5 -0
- data/smoke/diagnostics-rbs-duplicated/a.rbs +5 -0
- data/smoke/diagnostics-rbs-duplicated/test_expectations.yml +13 -0
- data/smoke/diagnostics-rbs/Steepfile +8 -0
- data/smoke/diagnostics-rbs/duplicated-method-definition.rbs +20 -0
- data/smoke/diagnostics-rbs/generic-parameter-mismatch.rbs +7 -0
- data/smoke/diagnostics-rbs/invalid-method-overload.rbs +3 -0
- data/smoke/diagnostics-rbs/invalid-type-application.rbs +7 -0
- data/smoke/diagnostics-rbs/invalid_variance_annotation.rbs +3 -0
- data/smoke/diagnostics-rbs/recursive-alias.rbs +5 -0
- data/smoke/diagnostics-rbs/recursive-class.rbs +8 -0
- data/smoke/diagnostics-rbs/superclass-mismatch.rbs +7 -0
- data/smoke/diagnostics-rbs/test_expectations.yml +231 -0
- data/smoke/diagnostics-rbs/unknown-method-alias.rbs +3 -0
- data/smoke/diagnostics-rbs/unknown-type-name-2.rbs +5 -0
- data/smoke/diagnostics-rbs/unknown-type-name.rbs +13 -0
- data/smoke/diagnostics/Steepfile +5 -0
- data/smoke/diagnostics/a.rbs +26 -0
- data/smoke/diagnostics/argument_type_mismatch.rb +1 -0
- data/smoke/diagnostics/block_body_type_mismatch.rb +1 -0
- data/smoke/diagnostics/block_type_mismatch.rb +3 -0
- data/smoke/diagnostics/break_type_mismatch.rb +1 -0
- data/smoke/diagnostics/else_on_exhaustive_case.rb +12 -0
- data/smoke/diagnostics/incompatible_annotation.rb +6 -0
- data/smoke/diagnostics/incompatible_argument.rb +1 -0
- data/smoke/diagnostics/incompatible_assignment.rb +8 -0
- data/smoke/diagnostics/method_arity_mismatch.rb +11 -0
- data/smoke/diagnostics/method_body_type_mismatch.rb +6 -0
- data/smoke/diagnostics/method_definition_missing.rb +2 -0
- data/smoke/diagnostics/method_return_type_annotation_mismatch.rb +7 -0
- data/smoke/diagnostics/missing_keyword.rb +1 -0
- data/smoke/diagnostics/no_method.rb +1 -0
- data/smoke/diagnostics/required_block_missing.rb +1 -0
- data/smoke/diagnostics/return_type_mismatch.rb +6 -0
- data/smoke/diagnostics/test_expectations.yml +477 -0
- data/smoke/diagnostics/unexpected_block_given.rb +1 -0
- data/smoke/diagnostics/unexpected_dynamic_method.rb +3 -0
- data/smoke/diagnostics/unexpected_jump.rb +4 -0
- data/smoke/diagnostics/unexpected_jump_value.rb +3 -0
- data/smoke/diagnostics/unexpected_keyword.rb +1 -0
- data/smoke/diagnostics/unexpected_splat.rb +1 -0
- data/smoke/diagnostics/unexpected_yield.rb +6 -0
- data/smoke/diagnostics/unknown_constant_assigned.rb +7 -0
- data/smoke/diagnostics/unresolved_overloading.rb +1 -0
- data/smoke/diagnostics/unsatisfiable_constraint.rb +7 -0
- data/smoke/diagnostics/unsupported_syntax.rb +2 -0
- data/smoke/dstr/a.rb +0 -1
- data/smoke/dstr/test_expectations.yml +13 -0
- data/smoke/ensure/a.rb +0 -4
- data/smoke/ensure/test_expectations.yml +62 -0
- data/smoke/enumerator/a.rb +0 -6
- data/smoke/enumerator/b.rb +0 -3
- data/smoke/enumerator/test_expectations.yml +135 -0
- data/smoke/extension/a.rb +0 -1
- data/smoke/extension/b.rb +0 -2
- data/smoke/extension/c.rb +0 -1
- 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/b.rb +0 -1
- data/smoke/hash/c.rb +0 -3
- data/smoke/hash/d.rb +0 -1
- data/smoke/hash/e.rb +0 -1
- data/smoke/hash/test_expectations.yml +81 -0
- data/smoke/hello/hello.rb +0 -2
- data/smoke/hello/test_expectations.yml +25 -0
- data/smoke/if/a.rb +0 -2
- data/smoke/if/test_expectations.yml +34 -0
- data/smoke/implements/a.rb +0 -2
- data/smoke/implements/test_expectations.yml +23 -0
- data/smoke/initialize/test_expectations.yml +1 -0
- data/smoke/integer/a.rb +0 -7
- data/smoke/integer/test_expectations.yml +101 -0
- data/smoke/interface/a.rb +0 -2
- data/smoke/interface/test_expectations.yml +23 -0
- data/smoke/kwbegin/a.rb +0 -1
- data/smoke/kwbegin/test_expectations.yml +17 -0
- data/smoke/lambda/a.rb +1 -4
- data/smoke/lambda/test_expectations.yml +39 -0
- data/smoke/literal/a.rb +0 -5
- data/smoke/literal/b.rb +0 -2
- data/smoke/literal/test_expectations.yml +106 -0
- data/smoke/map/test_expectations.yml +1 -0
- data/smoke/method/a.rb +0 -5
- data/smoke/method/b.rb +0 -1
- data/smoke/method/test_expectations.yml +90 -0
- data/smoke/module/a.rb +0 -2
- data/smoke/module/b.rb +0 -2
- data/smoke/module/c.rb +0 -1
- data/smoke/module/d.rb +0 -1
- data/smoke/module/f.rb +0 -2
- data/smoke/module/test_expectations.yml +75 -0
- data/smoke/regexp/a.rb +0 -38
- data/smoke/regexp/b.rb +0 -26
- data/smoke/regexp/test_expectations.yml +615 -0
- data/smoke/regression/set_divide.rb +0 -4
- data/smoke/regression/test_expectations.yml +43 -0
- data/smoke/rescue/a.rb +0 -5
- data/smoke/rescue/test_expectations.yml +79 -0
- data/smoke/self/a.rb +0 -2
- data/smoke/self/test_expectations.yml +23 -0
- data/smoke/skip/skip.rb +0 -2
- data/smoke/skip/test_expectations.yml +23 -0
- data/smoke/stdout/test_expectations.yml +1 -0
- data/smoke/super/a.rb +0 -4
- data/smoke/super/test_expectations.yml +79 -0
- data/smoke/toplevel/a.rb +0 -1
- data/smoke/toplevel/test_expectations.yml +15 -0
- data/smoke/tsort/Steepfile +2 -0
- data/smoke/tsort/a.rb +0 -3
- data/smoke/tsort/test_expectations.yml +63 -0
- data/smoke/type_case/a.rb +0 -4
- 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/a.rb +0 -3
- data/smoke/yield/b.rb +6 -0
- data/smoke/yield/test_expectations.yml +68 -0
- data/steep.gemspec +4 -3
- metadata +144 -29
- data/bin/smoke_runner.rb +0 -139
- data/lib/steep/drivers/signature_error_printer.rb +0 -25
- data/lib/steep/errors.rb +0 -565
- data/lib/steep/project/file_loader.rb +0 -68
- data/lib/steep/project/signature_file.rb +0 -33
- data/lib/steep/project/source_file.rb +0 -129
- data/lib/steep/server/code_worker.rb +0 -137
- data/lib/steep/server/signature_worker.rb +0 -152
- data/lib/steep/server/utils.rb +0 -69
- data/lib/steep/signature/errors.rb +0 -82
- data/lib/steep/type_assignability.rb +0 -367
@@ -1,16 +1,12 @@
|
|
1
1
|
d = Set["1","2","3"]
|
2
|
-
# !expects NoMethodError: type=::Set[::String], method=ffffffff
|
3
2
|
d.ffffffff
|
4
3
|
|
5
4
|
d.divide do |x, y|
|
6
|
-
# !expects NoMethodError: type=::String, method=ggggg
|
7
5
|
x.ggggg
|
8
6
|
|
9
|
-
# !expects NoMethodError: type=::String, method=ggggg
|
10
7
|
y.ggggg
|
11
8
|
end
|
12
9
|
|
13
10
|
d.divide do |x|
|
14
|
-
# !expects NoMethodError: type=::String, method=ggggg
|
15
11
|
x.ggggg
|
16
12
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
---
|
2
|
+
- file: set_divide.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 2
|
7
|
+
character: 2
|
8
|
+
end:
|
9
|
+
line: 2
|
10
|
+
character: 10
|
11
|
+
severity: ERROR
|
12
|
+
message: Type `::Set[::String]` does not have method `ffffffff`
|
13
|
+
code: Ruby::NoMethod
|
14
|
+
- range:
|
15
|
+
start:
|
16
|
+
line: 5
|
17
|
+
character: 4
|
18
|
+
end:
|
19
|
+
line: 5
|
20
|
+
character: 9
|
21
|
+
severity: ERROR
|
22
|
+
message: Type `::String` does not have method `ggggg`
|
23
|
+
code: Ruby::NoMethod
|
24
|
+
- range:
|
25
|
+
start:
|
26
|
+
line: 7
|
27
|
+
character: 4
|
28
|
+
end:
|
29
|
+
line: 7
|
30
|
+
character: 9
|
31
|
+
severity: ERROR
|
32
|
+
message: Type `::String` does not have method `ggggg`
|
33
|
+
code: Ruby::NoMethod
|
34
|
+
- range:
|
35
|
+
start:
|
36
|
+
line: 11
|
37
|
+
character: 4
|
38
|
+
end:
|
39
|
+
line: 11
|
40
|
+
character: 9
|
41
|
+
severity: ERROR
|
42
|
+
message: Type `::String` does not have method `ggggg`
|
43
|
+
code: Ruby::NoMethod
|
data/smoke/rescue/a.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# @type var a: Integer
|
2
2
|
|
3
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=(::String | ::Integer)
|
4
3
|
a = begin
|
5
4
|
'foo'
|
6
5
|
rescue
|
@@ -9,12 +8,10 @@ a = begin
|
|
9
8
|
|
10
9
|
# @type var b: Integer
|
11
10
|
|
12
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=(::String | ::Integer)
|
13
11
|
b = 'foo' rescue 1
|
14
12
|
|
15
13
|
# @type var c: Integer
|
16
14
|
|
17
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=(::String | ::Symbol | ::Integer)
|
18
15
|
c = begin
|
19
16
|
'foo'
|
20
17
|
rescue RuntimeError
|
@@ -25,7 +22,6 @@ c = begin
|
|
25
22
|
|
26
23
|
# @type var e: Integer
|
27
24
|
|
28
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=(::Array[::Integer] | ::Symbol | ::Integer)
|
29
25
|
e = begin
|
30
26
|
'foo'
|
31
27
|
rescue RuntimeError
|
@@ -38,7 +34,6 @@ e = begin
|
|
38
34
|
|
39
35
|
# @type method foo: (String) -> String
|
40
36
|
|
41
|
-
# !expects MethodBodyTypeMismatch: method=foo, expected=::String, actual=(::Integer | ::String)
|
42
37
|
def foo(a)
|
43
38
|
10
|
44
39
|
rescue
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 3
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 7
|
10
|
+
character: 7
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot assign a value of type `(::String | ::Integer)` to a variable of type `::Integer`
|
14
|
+
(::String | ::Integer) <: ::Integer
|
15
|
+
::String <: ::Integer
|
16
|
+
::Object <: ::Integer
|
17
|
+
::BasicObject <: ::Integer
|
18
|
+
code: Ruby::IncompatibleAssignment
|
19
|
+
- range:
|
20
|
+
start:
|
21
|
+
line: 11
|
22
|
+
character: 0
|
23
|
+
end:
|
24
|
+
line: 11
|
25
|
+
character: 18
|
26
|
+
severity: ERROR
|
27
|
+
message: |-
|
28
|
+
Cannot assign a value of type `(::String | ::Integer)` to a variable of type `::Integer`
|
29
|
+
(::String | ::Integer) <: ::Integer
|
30
|
+
::String <: ::Integer
|
31
|
+
::Object <: ::Integer
|
32
|
+
::BasicObject <: ::Integer
|
33
|
+
code: Ruby::IncompatibleAssignment
|
34
|
+
- range:
|
35
|
+
start:
|
36
|
+
line: 15
|
37
|
+
character: 0
|
38
|
+
end:
|
39
|
+
line: 21
|
40
|
+
character: 7
|
41
|
+
severity: ERROR
|
42
|
+
message: |-
|
43
|
+
Cannot assign a value of type `(::String | ::Symbol | ::Integer)` to a variable of type `::Integer`
|
44
|
+
(::String | ::Symbol | ::Integer) <: ::Integer
|
45
|
+
::String <: ::Integer
|
46
|
+
::Object <: ::Integer
|
47
|
+
::BasicObject <: ::Integer
|
48
|
+
code: Ruby::IncompatibleAssignment
|
49
|
+
- range:
|
50
|
+
start:
|
51
|
+
line: 25
|
52
|
+
character: 0
|
53
|
+
end:
|
54
|
+
line: 33
|
55
|
+
character: 7
|
56
|
+
severity: ERROR
|
57
|
+
message: |-
|
58
|
+
Cannot assign a value of type `(::Array[::Integer] | ::Symbol | ::Integer)` to a variable of type `::Integer`
|
59
|
+
(::Array[::Integer] | ::Symbol | ::Integer) <: ::Integer
|
60
|
+
::Array[::Integer] <: ::Integer
|
61
|
+
::Object <: ::Integer
|
62
|
+
::BasicObject <: ::Integer
|
63
|
+
code: Ruby::IncompatibleAssignment
|
64
|
+
- range:
|
65
|
+
start:
|
66
|
+
line: 37
|
67
|
+
character: 0
|
68
|
+
end:
|
69
|
+
line: 41
|
70
|
+
character: 3
|
71
|
+
severity: ERROR
|
72
|
+
message: |-
|
73
|
+
Cannot allow method body have type `(::Integer | ::String)` because declared as type `::String`
|
74
|
+
(::Integer | ::String) <: ::String
|
75
|
+
::Integer <: ::String
|
76
|
+
::Numeric <: ::String
|
77
|
+
::Object <: ::String
|
78
|
+
::BasicObject <: ::String
|
79
|
+
code: Ruby::MethodBodyTypeMismatch
|
data/smoke/self/a.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 16
|
7
|
+
character: 2
|
8
|
+
end:
|
9
|
+
line: 16
|
10
|
+
character: 5
|
11
|
+
severity: ERROR
|
12
|
+
message: Type `::Object` does not have method `baz`
|
13
|
+
code: Ruby::NoMethod
|
14
|
+
- range:
|
15
|
+
start:
|
16
|
+
line: 19
|
17
|
+
character: 4
|
18
|
+
end:
|
19
|
+
line: 19
|
20
|
+
character: 7
|
21
|
+
severity: ERROR
|
22
|
+
message: Type `::Object` does not have method `baz`
|
23
|
+
code: Ruby::NoMethod
|
data/smoke/skip/skip.rb
CHANGED
@@ -5,11 +5,9 @@ end
|
|
5
5
|
# @type var foo: String
|
6
6
|
|
7
7
|
foo = _ = begin
|
8
|
-
# !expects NoMethodError: type=::Object, method=no_such_method
|
9
8
|
self.no_such_method
|
10
9
|
end
|
11
10
|
|
12
11
|
foo = __any__ = begin
|
13
|
-
# !expects NoMethodError: type=::Object, method=no_such_method
|
14
12
|
self.no_such_method
|
15
13
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
- file: skip.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 8
|
7
|
+
character: 7
|
8
|
+
end:
|
9
|
+
line: 8
|
10
|
+
character: 21
|
11
|
+
severity: ERROR
|
12
|
+
message: Type `::Object` does not have method `no_such_method`
|
13
|
+
code: Ruby::NoMethod
|
14
|
+
- range:
|
15
|
+
start:
|
16
|
+
line: 12
|
17
|
+
character: 7
|
18
|
+
end:
|
19
|
+
line: 12
|
20
|
+
character: 21
|
21
|
+
severity: ERROR
|
22
|
+
message: Type `::Object` does not have method `no_such_method`
|
23
|
+
code: Ruby::NoMethod
|
@@ -0,0 +1 @@
|
|
1
|
+
--- []
|
data/smoke/super/a.rb
CHANGED
@@ -3,9 +3,7 @@ class A
|
|
3
3
|
# @type self: A
|
4
4
|
|
5
5
|
# @type var a: Integer
|
6
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=::Object
|
7
6
|
a = super(x)
|
8
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=::Object
|
9
7
|
a = super
|
10
8
|
|
11
9
|
# @type var b: Object
|
@@ -25,10 +23,8 @@ class A
|
|
25
23
|
def baz
|
26
24
|
# @type self: A
|
27
25
|
|
28
|
-
# !expects UnexpectedSuper: method=baz
|
29
26
|
super()
|
30
27
|
|
31
|
-
# !expects UnexpectedSuper: method=baz
|
32
28
|
super
|
33
29
|
end
|
34
30
|
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 6
|
7
|
+
character: 4
|
8
|
+
end:
|
9
|
+
line: 6
|
10
|
+
character: 16
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot assign a value of type `::Object` to a variable of type `::Integer`
|
14
|
+
::Object <: ::Integer
|
15
|
+
::BasicObject <: ::Integer
|
16
|
+
code: Ruby::IncompatibleAssignment
|
17
|
+
- range:
|
18
|
+
start:
|
19
|
+
line: 7
|
20
|
+
character: 4
|
21
|
+
end:
|
22
|
+
line: 7
|
23
|
+
character: 13
|
24
|
+
severity: ERROR
|
25
|
+
message: |-
|
26
|
+
Cannot assign a value of type `::Object` to a variable of type `::Integer`
|
27
|
+
::Object <: ::Integer
|
28
|
+
::BasicObject <: ::Integer
|
29
|
+
code: Ruby::IncompatibleAssignment
|
30
|
+
- range:
|
31
|
+
start:
|
32
|
+
line: 19
|
33
|
+
character: 4
|
34
|
+
end:
|
35
|
+
line: 19
|
36
|
+
character: 11
|
37
|
+
severity: ERROR
|
38
|
+
message: Cannot detect the type of the expression
|
39
|
+
code: Ruby::FallbackAny
|
40
|
+
- range:
|
41
|
+
start:
|
42
|
+
line: 20
|
43
|
+
character: 4
|
44
|
+
end:
|
45
|
+
line: 20
|
46
|
+
character: 9
|
47
|
+
severity: ERROR
|
48
|
+
message: Cannot detect the type of the expression
|
49
|
+
code: Ruby::FallbackAny
|
50
|
+
- range:
|
51
|
+
start:
|
52
|
+
line: 26
|
53
|
+
character: 4
|
54
|
+
end:
|
55
|
+
line: 26
|
56
|
+
character: 11
|
57
|
+
severity: ERROR
|
58
|
+
message: UnexpectedSuper
|
59
|
+
code: Ruby::UnexpectedSuper
|
60
|
+
- range:
|
61
|
+
start:
|
62
|
+
line: 28
|
63
|
+
character: 4
|
64
|
+
end:
|
65
|
+
line: 28
|
66
|
+
character: 9
|
67
|
+
severity: ERROR
|
68
|
+
message: Cannot detect the type of the expression
|
69
|
+
code: Ruby::FallbackAny
|
70
|
+
- range:
|
71
|
+
start:
|
72
|
+
line: 28
|
73
|
+
character: 4
|
74
|
+
end:
|
75
|
+
line: 28
|
76
|
+
character: 9
|
77
|
+
severity: ERROR
|
78
|
+
message: UnexpectedSuper
|
79
|
+
code: Ruby::UnexpectedSuper
|
data/smoke/toplevel/a.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 1
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 3
|
10
|
+
character: 3
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot allow method body have type `nil` because declared as type `::String`
|
14
|
+
nil <: ::String
|
15
|
+
code: Ruby::MethodBodyTypeMismatch
|
data/smoke/tsort/Steepfile
CHANGED
data/smoke/tsort/a.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# ALLOW FAILURE
|
2
|
-
|
3
1
|
require "tsort"
|
4
2
|
|
5
3
|
# @type var g: Hash[Integer, Array[Integer]]
|
@@ -11,5 +9,4 @@ each_node = -> (&b) { g.each_key(&b) }
|
|
11
9
|
each_child = -> (n, &b) { g[n].each(&b) }
|
12
10
|
|
13
11
|
# @type var xs: Array[String]
|
14
|
-
# !expects IncompatibleAssignment: lhs_type=::Array[::String], rhs_type=::Array[::Integer]
|
15
12
|
xs = TSort.tsort(each_node, each_child)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 7
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 7
|
10
|
+
character: 38
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot assign a value of type `^() -> ::Hash[::Integer, ::Array[::Integer]]` to a variable of type `^() { (::Integer) -> void } -> void`
|
14
|
+
^() -> ::Hash[::Integer, ::Array[::Integer]] <: ^() { (::Integer) -> void } -> void
|
15
|
+
code: Ruby::IncompatibleAssignment
|
16
|
+
- range:
|
17
|
+
start:
|
18
|
+
line: 7
|
19
|
+
character: 34
|
20
|
+
end:
|
21
|
+
line: 7
|
22
|
+
character: 35
|
23
|
+
severity: ERROR
|
24
|
+
message: Cannot detect the type of the expression
|
25
|
+
code: Ruby::FallbackAny
|
26
|
+
- range:
|
27
|
+
start:
|
28
|
+
line: 9
|
29
|
+
character: 0
|
30
|
+
end:
|
31
|
+
line: 9
|
32
|
+
character: 41
|
33
|
+
severity: ERROR
|
34
|
+
message: |-
|
35
|
+
Cannot assign a value of type `^(::Integer) -> ::Array[::Integer]` to a variable of type `^(::Integer) { (::Integer) -> void } -> void`
|
36
|
+
^(::Integer) -> ::Array[::Integer] <: ^(::Integer) { (::Integer) -> void } -> void
|
37
|
+
code: Ruby::IncompatibleAssignment
|
38
|
+
- range:
|
39
|
+
start:
|
40
|
+
line: 9
|
41
|
+
character: 37
|
42
|
+
end:
|
43
|
+
line: 9
|
44
|
+
character: 38
|
45
|
+
severity: ERROR
|
46
|
+
message: Cannot detect the type of the expression
|
47
|
+
code: Ruby::FallbackAny
|
48
|
+
- range:
|
49
|
+
start:
|
50
|
+
line: 12
|
51
|
+
character: 0
|
52
|
+
end:
|
53
|
+
line: 12
|
54
|
+
character: 39
|
55
|
+
severity: ERROR
|
56
|
+
message: |-
|
57
|
+
Cannot assign a value of type `::Array[::Integer]` to a variable of type `::Array[::String]`
|
58
|
+
::Array[::Integer] <: ::Array[::String]
|
59
|
+
::Integer <: ::String
|
60
|
+
::Numeric <: ::String
|
61
|
+
::Object <: ::String
|
62
|
+
::BasicObject <: ::String
|
63
|
+
code: Ruby::IncompatibleAssignment
|