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
data/smoke/lambda/a.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# @type var a: Integer
|
2
2
|
|
3
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=::String
|
4
3
|
a = -> (x, y) do
|
5
4
|
# @type var x: String
|
6
5
|
# @type var y: String
|
@@ -8,10 +7,8 @@ a = -> (x, y) do
|
|
8
7
|
end["foo", "bar"]
|
9
8
|
|
10
9
|
# @type var b: ^(Integer) -> Integer
|
11
|
-
# !expects IncompatibleAssignment: lhs_type=^(::Integer) -> ::Integer, rhs_type=::Proc
|
12
10
|
b = lambda do |x|
|
13
|
-
|
14
|
-
x + 1
|
11
|
+
x + 1
|
15
12
|
end
|
16
13
|
|
17
14
|
# @type var c: ^(Integer) -> Integer
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 3
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 7
|
10
|
+
character: 17
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot assign a value of type `::String` to a variable of type `::Integer`
|
14
|
+
::String <: ::Integer
|
15
|
+
::Object <: ::Integer
|
16
|
+
::BasicObject <: ::Integer
|
17
|
+
code: Ruby::IncompatibleAssignment
|
18
|
+
- range:
|
19
|
+
start:
|
20
|
+
line: 10
|
21
|
+
character: 0
|
22
|
+
end:
|
23
|
+
line: 12
|
24
|
+
character: 3
|
25
|
+
severity: ERROR
|
26
|
+
message: |-
|
27
|
+
Cannot assign a value of type `::Proc` to a variable of type `^(::Integer) -> ::Integer`
|
28
|
+
::Proc <: ^(::Integer) -> ::Integer
|
29
|
+
code: Ruby::IncompatibleAssignment
|
30
|
+
- range:
|
31
|
+
start:
|
32
|
+
line: 11
|
33
|
+
character: 4
|
34
|
+
end:
|
35
|
+
line: 11
|
36
|
+
character: 5
|
37
|
+
severity: ERROR
|
38
|
+
message: Type `nil` does not have method `+`
|
39
|
+
code: Ruby::NoMethod
|
data/smoke/literal/a.rb
CHANGED
@@ -1,16 +1,11 @@
|
|
1
1
|
# @type var x: String
|
2
2
|
# @type var y: Integer
|
3
3
|
|
4
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
5
4
|
x = 1
|
6
5
|
|
7
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Symbol
|
8
6
|
x = :foo
|
9
7
|
|
10
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=::String
|
11
8
|
y = "foo"
|
12
9
|
|
13
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=bool
|
14
10
|
x = true
|
15
|
-
# !expects IncompatibleAssignment: lhs_type=::Integer, rhs_type=bool
|
16
11
|
y = false
|
data/smoke/literal/b.rb
CHANGED
@@ -0,0 +1,106 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 4
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 4
|
10
|
+
character: 5
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot assign a value of type `::Integer` to a variable of type `::String`
|
14
|
+
::Integer <: ::String
|
15
|
+
::Numeric <: ::String
|
16
|
+
::Object <: ::String
|
17
|
+
::BasicObject <: ::String
|
18
|
+
code: Ruby::IncompatibleAssignment
|
19
|
+
- range:
|
20
|
+
start:
|
21
|
+
line: 6
|
22
|
+
character: 0
|
23
|
+
end:
|
24
|
+
line: 6
|
25
|
+
character: 8
|
26
|
+
severity: ERROR
|
27
|
+
message: |-
|
28
|
+
Cannot assign a value of type `::Symbol` to a variable of type `::String`
|
29
|
+
::Symbol <: ::String
|
30
|
+
::Object <: ::String
|
31
|
+
::BasicObject <: ::String
|
32
|
+
code: Ruby::IncompatibleAssignment
|
33
|
+
- range:
|
34
|
+
start:
|
35
|
+
line: 8
|
36
|
+
character: 0
|
37
|
+
end:
|
38
|
+
line: 8
|
39
|
+
character: 9
|
40
|
+
severity: ERROR
|
41
|
+
message: |-
|
42
|
+
Cannot assign a value of type `::String` to a variable of type `::Integer`
|
43
|
+
::String <: ::Integer
|
44
|
+
::Object <: ::Integer
|
45
|
+
::BasicObject <: ::Integer
|
46
|
+
code: Ruby::IncompatibleAssignment
|
47
|
+
- range:
|
48
|
+
start:
|
49
|
+
line: 10
|
50
|
+
character: 0
|
51
|
+
end:
|
52
|
+
line: 10
|
53
|
+
character: 8
|
54
|
+
severity: ERROR
|
55
|
+
message: |-
|
56
|
+
Cannot assign a value of type `bool` to a variable of type `::String`
|
57
|
+
bool <: ::String
|
58
|
+
(true | false) <: ::String
|
59
|
+
true <: ::String
|
60
|
+
::TrueClass <: ::String
|
61
|
+
::Object <: ::String
|
62
|
+
::BasicObject <: ::String
|
63
|
+
code: Ruby::IncompatibleAssignment
|
64
|
+
- range:
|
65
|
+
start:
|
66
|
+
line: 11
|
67
|
+
character: 0
|
68
|
+
end:
|
69
|
+
line: 11
|
70
|
+
character: 9
|
71
|
+
severity: ERROR
|
72
|
+
message: |-
|
73
|
+
Cannot assign a value of type `bool` to a variable of type `::Integer`
|
74
|
+
bool <: ::Integer
|
75
|
+
(true | false) <: ::Integer
|
76
|
+
true <: ::Integer
|
77
|
+
::TrueClass <: ::Integer
|
78
|
+
::Object <: ::Integer
|
79
|
+
::BasicObject <: ::Integer
|
80
|
+
code: Ruby::IncompatibleAssignment
|
81
|
+
- file: b.rb
|
82
|
+
diagnostics:
|
83
|
+
- range:
|
84
|
+
start:
|
85
|
+
line: 4
|
86
|
+
character: 6
|
87
|
+
end:
|
88
|
+
line: 4
|
89
|
+
character: 7
|
90
|
+
severity: ERROR
|
91
|
+
message: |-
|
92
|
+
Cannot pass a value of type `::Integer` as an argument of type `3`
|
93
|
+
::Integer <: 3
|
94
|
+
code: Ruby::ArgumentTypeMismatch
|
95
|
+
- range:
|
96
|
+
start:
|
97
|
+
line: 7
|
98
|
+
character: 11
|
99
|
+
end:
|
100
|
+
line: 7
|
101
|
+
character: 15
|
102
|
+
severity: ERROR
|
103
|
+
message: |-
|
104
|
+
Cannot assign a value of type `::Symbol` to an expression of type `:foo`
|
105
|
+
::Symbol <: :foo
|
106
|
+
code: Ruby::IncompatibleAssignment
|
@@ -0,0 +1 @@
|
|
1
|
+
--- []
|
data/smoke/method/a.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
# @type method foo: (Integer, y: Integer) -> String
|
2
2
|
|
3
|
-
# !expects MethodBodyTypeMismatch: method=foo, expected=::String, actual=::Integer
|
4
3
|
def foo(x, y:)
|
5
4
|
# @type var z: String
|
6
5
|
|
7
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
8
6
|
z = x
|
9
7
|
|
10
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
11
8
|
z = y
|
12
9
|
|
13
10
|
3
|
@@ -15,11 +12,9 @@ end
|
|
15
12
|
|
16
13
|
# @type method bar: (Integer) -> String
|
17
14
|
|
18
|
-
# !expects MethodArityMismatch: method=bar
|
19
15
|
def bar(x, y)
|
20
16
|
# @type var z: String
|
21
17
|
|
22
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
23
18
|
z = x
|
24
19
|
|
25
20
|
z = y
|
data/smoke/method/b.rb
CHANGED
@@ -0,0 +1,90 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 3
|
7
|
+
character: 0
|
8
|
+
end:
|
9
|
+
line: 11
|
10
|
+
character: 3
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot allow method body have type `::Integer` because declared as type `::String`
|
14
|
+
::Integer <: ::String
|
15
|
+
::Numeric <: ::String
|
16
|
+
::Object <: ::String
|
17
|
+
::BasicObject <: ::String
|
18
|
+
code: Ruby::MethodBodyTypeMismatch
|
19
|
+
- range:
|
20
|
+
start:
|
21
|
+
line: 6
|
22
|
+
character: 2
|
23
|
+
end:
|
24
|
+
line: 6
|
25
|
+
character: 7
|
26
|
+
severity: ERROR
|
27
|
+
message: |-
|
28
|
+
Cannot assign a value of type `::Integer` to a variable of type `::String`
|
29
|
+
::Integer <: ::String
|
30
|
+
::Numeric <: ::String
|
31
|
+
::Object <: ::String
|
32
|
+
::BasicObject <: ::String
|
33
|
+
code: Ruby::IncompatibleAssignment
|
34
|
+
- range:
|
35
|
+
start:
|
36
|
+
line: 8
|
37
|
+
character: 2
|
38
|
+
end:
|
39
|
+
line: 8
|
40
|
+
character: 7
|
41
|
+
severity: ERROR
|
42
|
+
message: |-
|
43
|
+
Cannot assign a value of type `::Integer` to a variable of type `::String`
|
44
|
+
::Integer <: ::String
|
45
|
+
::Numeric <: ::String
|
46
|
+
::Object <: ::String
|
47
|
+
::BasicObject <: ::String
|
48
|
+
code: Ruby::IncompatibleAssignment
|
49
|
+
- range:
|
50
|
+
start:
|
51
|
+
line: 15
|
52
|
+
character: 7
|
53
|
+
end:
|
54
|
+
line: 15
|
55
|
+
character: 13
|
56
|
+
severity: ERROR
|
57
|
+
message: Method parameters are incompatible with declaration `(::Integer) -> ::String`
|
58
|
+
code: Ruby::MethodArityMismatch
|
59
|
+
- range:
|
60
|
+
start:
|
61
|
+
line: 18
|
62
|
+
character: 2
|
63
|
+
end:
|
64
|
+
line: 18
|
65
|
+
character: 7
|
66
|
+
severity: ERROR
|
67
|
+
message: |-
|
68
|
+
Cannot assign a value of type `::Integer` to a variable of type `::String`
|
69
|
+
::Integer <: ::String
|
70
|
+
::Numeric <: ::String
|
71
|
+
::Object <: ::String
|
72
|
+
::BasicObject <: ::String
|
73
|
+
code: Ruby::IncompatibleAssignment
|
74
|
+
- file: b.rb
|
75
|
+
diagnostics:
|
76
|
+
- range:
|
77
|
+
start:
|
78
|
+
line: 4
|
79
|
+
character: 2
|
80
|
+
end:
|
81
|
+
line: 6
|
82
|
+
character: 5
|
83
|
+
severity: ERROR
|
84
|
+
message: |-
|
85
|
+
Cannot allow method body have type `::Symbol` because declared as type `(::Integer | ::String)`
|
86
|
+
::Symbol <: (::Integer | ::String)
|
87
|
+
::Symbol <: ::Integer
|
88
|
+
::Object <: ::Integer
|
89
|
+
::BasicObject <: ::Integer
|
90
|
+
code: Ruby::MethodBodyTypeMismatch
|
data/smoke/module/a.rb
CHANGED
data/smoke/module/b.rb
CHANGED
data/smoke/module/c.rb
CHANGED
data/smoke/module/d.rb
CHANGED
data/smoke/module/f.rb
CHANGED
@@ -0,0 +1,75 @@
|
|
1
|
+
---
|
2
|
+
- file: a.rb
|
3
|
+
diagnostics:
|
4
|
+
- range:
|
5
|
+
start:
|
6
|
+
line: 13
|
7
|
+
character: 4
|
8
|
+
end:
|
9
|
+
line: 13
|
10
|
+
character: 9
|
11
|
+
severity: ERROR
|
12
|
+
message: |-
|
13
|
+
Cannot assign a value of type `::Integer` to a variable of type `::String`
|
14
|
+
::Integer <: ::String
|
15
|
+
::Numeric <: ::String
|
16
|
+
::Object <: ::String
|
17
|
+
::BasicObject <: ::String
|
18
|
+
code: Ruby::IncompatibleAssignment
|
19
|
+
- range:
|
20
|
+
start:
|
21
|
+
line: 15
|
22
|
+
character: 4
|
23
|
+
end:
|
24
|
+
line: 15
|
25
|
+
character: 7
|
26
|
+
severity: ERROR
|
27
|
+
message: Type `(::Object & ::_Each2[::Integer, ::A] & ::A)` does not have method
|
28
|
+
`foo`
|
29
|
+
code: Ruby::NoMethod
|
30
|
+
- file: c.rb
|
31
|
+
diagnostics:
|
32
|
+
- range:
|
33
|
+
start:
|
34
|
+
line: 21
|
35
|
+
character: 2
|
36
|
+
end:
|
37
|
+
line: 21
|
38
|
+
character: 26
|
39
|
+
severity: ERROR
|
40
|
+
message: Type `singleton(::A)` does not have method `no_such_method_in_module`
|
41
|
+
code: Ruby::NoMethod
|
42
|
+
- file: d.rb
|
43
|
+
diagnostics:
|
44
|
+
- range:
|
45
|
+
start:
|
46
|
+
line: 3
|
47
|
+
character: 7
|
48
|
+
end:
|
49
|
+
line: 3
|
50
|
+
character: 8
|
51
|
+
severity: ERROR
|
52
|
+
message: Cannot find implementation of method `::X#foo`
|
53
|
+
code: Ruby::MethodDefinitionMissing
|
54
|
+
- file: f.rb
|
55
|
+
diagnostics:
|
56
|
+
- range:
|
57
|
+
start:
|
58
|
+
line: 1
|
59
|
+
character: 7
|
60
|
+
end:
|
61
|
+
line: 1
|
62
|
+
character: 14
|
63
|
+
severity: ERROR
|
64
|
+
message: Cannot find implementation of method `::Palette.nestopia_palette`
|
65
|
+
code: Ruby::MethodDefinitionMissing
|
66
|
+
- range:
|
67
|
+
start:
|
68
|
+
line: 1
|
69
|
+
character: 7
|
70
|
+
end:
|
71
|
+
line: 1
|
72
|
+
character: 14
|
73
|
+
severity: ERROR
|
74
|
+
message: "@dynamic annotation contains unknown method name `nestopia_palette`"
|
75
|
+
code: Ruby::UnexpectedDynamicMethod
|
data/smoke/regexp/a.rb
CHANGED
@@ -1,147 +1,109 @@
|
|
1
|
-
# ALLOW FAILURE
|
2
|
-
|
3
1
|
new_1 = Regexp.new("a")
|
4
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
5
2
|
new_1.foo
|
6
3
|
|
7
4
|
new_2 = Regexp.new("a", true)
|
8
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
9
5
|
new_2.foo
|
10
6
|
|
11
7
|
new_3 = Regexp.new("a", Regexp::EXTENDED | Regexp::IGNORECASE)
|
12
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
13
8
|
new_3.foo
|
14
9
|
|
15
10
|
new_4 = Regexp.new(/a/)
|
16
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
17
11
|
new_4.foo
|
18
12
|
|
19
13
|
compile_1 = Regexp.compile("a")
|
20
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
21
14
|
compile_1.foo
|
22
15
|
|
23
16
|
compile_2 = Regexp.compile("a", true)
|
24
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
25
17
|
compile_2.foo
|
26
18
|
|
27
19
|
compile_3 = Regexp.compile("a", Regexp::EXTENDED | Regexp::IGNORECASE)
|
28
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
29
20
|
compile_3.foo
|
30
21
|
|
31
22
|
compile_4 = Regexp.compile(/a/)
|
32
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
33
23
|
compile_4.foo
|
34
24
|
|
35
25
|
escape_1 = Regexp.escape("a")
|
36
|
-
# !expects NoMethodError: type=::String, method=foo
|
37
26
|
escape_1.foo
|
38
27
|
|
39
28
|
last_match_1 = Regexp.last_match
|
40
|
-
# !expects NoMethodError: type=(::MatchData | nil), method=foo
|
41
29
|
last_match_1.foo
|
42
30
|
|
43
31
|
last_match_2 = Regexp.last_match(1)
|
44
|
-
# !expects NoMethodError: type=(::String | nil), method=foo
|
45
32
|
last_match_2.foo
|
46
33
|
|
47
34
|
quote_1 = Regexp.quote("a")
|
48
|
-
# !expects NoMethodError: type=::String, method=foo
|
49
35
|
quote_1.foo
|
50
36
|
|
51
37
|
try_convert_1 = Regexp.try_convert(Object.new)
|
52
|
-
# !expects NoMethodError: type=(::Regexp | nil), method=foo
|
53
38
|
try_convert_1.foo
|
54
39
|
|
55
40
|
union_1 = Regexp.union
|
56
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
57
41
|
union_1.foo
|
58
42
|
|
59
43
|
union_2 = Regexp.union("a")
|
60
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
61
44
|
union_2.foo
|
62
45
|
|
63
46
|
union_3 = Regexp.union("a", "b")
|
64
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
65
47
|
union_3.foo
|
66
48
|
|
67
49
|
union_4 = Regexp.union(["a", "b"])
|
68
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
69
50
|
union_4.foo
|
70
51
|
|
71
52
|
union_5 = Regexp.union(/a/)
|
72
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
73
53
|
union_5.foo
|
74
54
|
|
75
55
|
union_6 = Regexp.union(/a/, /b/)
|
76
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
77
56
|
union_6.foo
|
78
57
|
|
79
58
|
union_7 = Regexp.union([/a/, /b/])
|
80
|
-
# !expects NoMethodError: type=::Regexp, method=foo
|
81
59
|
union_7.foo
|
82
60
|
|
83
61
|
op_eqeqeq_1 = /a/ === "a"
|
84
|
-
# !expects NoMethodError: type=bool, method=foo
|
85
62
|
op_eqeqeq_1.foo
|
86
63
|
|
87
64
|
op_match_1 = /a/ =~ "a"
|
88
|
-
# !expects NoMethodError: type=::Integer, method=foo
|
89
65
|
op_match_1.foo
|
90
66
|
|
91
67
|
casefold_1 = /a/.casefold?
|
92
|
-
# !expects NoMethodError: type=bool, method=foo
|
93
68
|
casefold_1.foo
|
94
69
|
|
95
70
|
encoding_1 = /a/.encoding
|
96
|
-
# !expects NoMethodError: type=::Encoding, method=foo
|
97
71
|
encoding_1.foo
|
98
72
|
|
99
73
|
fixed_encoding_1 = /a/.fixed_encoding?
|
100
|
-
# !expects NoMethodError: type=bool, method=foo
|
101
74
|
fixed_encoding_1.foo
|
102
75
|
|
103
76
|
match_1 = /a/.match("a")
|
104
|
-
# !expects NoMethodError: type=(::MatchData | nil), method=foo
|
105
77
|
match_1.foo
|
106
78
|
|
107
79
|
match_2 = /a/.match("a", 0)
|
108
|
-
# !expects NoMethodError: type=(::MatchData | nil), method=foo
|
109
80
|
match_2.foo
|
110
81
|
|
111
82
|
/a/.match("a") do |m|
|
112
|
-
# !expects NoMethodError: type=::MatchData, method=foo
|
113
83
|
m.foo
|
114
84
|
end
|
115
85
|
|
116
86
|
/a/.match("a", 0) do |m|
|
117
|
-
# !expects NoMethodError: type=::MatchData, method=foo
|
118
87
|
m.foo
|
119
88
|
end
|
120
89
|
|
121
90
|
match_q_1 = /a/.match?("a")
|
122
|
-
# !expects NoMethodError: type=bool, method=foo
|
123
91
|
match_q_1.foo
|
124
92
|
|
125
93
|
match_q_2 = /a/.match?("a", 0)
|
126
|
-
# !expects NoMethodError: type=bool, method=foo
|
127
94
|
match_q_2.foo
|
128
95
|
|
129
96
|
named_captures_1 = /(?<foo>.)/.named_captures
|
130
|
-
# !expects NoMethodError: type=::Hash[::String, ::Array[::Integer]], method=foo
|
131
97
|
named_captures_1.foo
|
132
98
|
|
133
99
|
names_1 = /(?<foo>.)/.names
|
134
|
-
# !expects NoMethodError: type=::Array[::String], method=foo
|
135
100
|
names_1.foo
|
136
101
|
|
137
102
|
options_1 = /a/ix.options
|
138
|
-
# !expects NoMethodError: type=::Integer, method=foo
|
139
103
|
options_1.foo
|
140
104
|
|
141
105
|
source_1 = /a/ix.source
|
142
|
-
# !expects NoMethodError: type=::String, method=foo
|
143
106
|
source_1.foo
|
144
107
|
|
145
108
|
op_unary_match_1 = ~ /a/
|
146
|
-
# !expects NoMethodError: type=(::Integer | nil), method=foo
|
147
109
|
op_unary_match_1.foo
|