steep 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/Rakefile +5 -2
- data/bin/output_rebaseline.rb +49 -0
- data/bin/output_test.rb +93 -0
- data/lib/steep.rb +8 -3
- data/lib/steep/cli.rb +1 -1
- data/lib/steep/diagnostic/helper.rb +17 -0
- data/lib/steep/diagnostic/lsp_formatter.rb +16 -0
- data/lib/steep/diagnostic/ruby.rb +623 -0
- data/lib/steep/diagnostic/signature.rb +224 -0
- data/lib/steep/drivers/annotations.rb +13 -6
- data/lib/steep/drivers/check.rb +83 -60
- data/lib/steep/drivers/diagnostic_printer.rb +94 -0
- data/lib/steep/drivers/stats.rb +125 -29
- data/lib/steep/drivers/trace_printer.rb +5 -1
- data/lib/steep/drivers/validate.rb +13 -6
- data/lib/steep/drivers/watch.rb +26 -9
- data/lib/steep/drivers/worker.rb +5 -0
- data/lib/steep/project/options.rb +4 -4
- data/lib/steep/project/signature_file.rb +8 -2
- data/lib/steep/project/stats_calculator.rb +80 -0
- data/lib/steep/project/target.rb +64 -53
- data/lib/steep/range_extension.rb +29 -0
- data/lib/steep/server/base_worker.rb +42 -4
- data/lib/steep/server/code_worker.rb +37 -24
- data/lib/steep/server/interaction_worker.rb +1 -0
- data/lib/steep/server/master.rb +268 -82
- data/lib/steep/server/signature_worker.rb +7 -59
- data/lib/steep/server/worker_process.rb +9 -9
- data/lib/steep/signature/validator.rb +33 -9
- data/lib/steep/type_construction.rb +276 -194
- 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.yaml +73 -0
- data/smoke/and/a.rb +0 -3
- data/smoke/and/test.yaml +24 -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.yaml +80 -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.yaml +96 -0
- data/smoke/broken/Steepfile +5 -0
- data/smoke/broken/broken.rb +0 -0
- data/smoke/broken/broken.rbs +0 -0
- data/smoke/broken/test.yaml +6 -0
- data/smoke/case/a.rb +0 -3
- data/smoke/case/test.yaml +36 -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.yaml +89 -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.yaml +96 -0
- data/smoke/diagnostics-rbs-duplicated/Steepfile +5 -0
- data/smoke/diagnostics-rbs-duplicated/a.rbs +5 -0
- data/smoke/diagnostics-rbs-duplicated/test.yaml +10 -0
- data/smoke/diagnostics-rbs/Steepfile +5 -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.yaml +142 -0
- data/smoke/diagnostics-rbs/unknown-method-alias.rbs +3 -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.yaml +333 -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.yaml +10 -0
- data/smoke/ensure/a.rb +0 -4
- data/smoke/ensure/test.yaml +47 -0
- data/smoke/enumerator/a.rb +0 -6
- data/smoke/enumerator/b.rb +0 -3
- data/smoke/enumerator/test.yaml +100 -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/test.yaml +50 -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.yaml +62 -0
- data/smoke/hello/hello.rb +0 -2
- data/smoke/hello/test.yaml +18 -0
- data/smoke/if/a.rb +0 -2
- data/smoke/if/test.yaml +27 -0
- data/smoke/implements/a.rb +0 -2
- data/smoke/implements/test.yaml +16 -0
- data/smoke/initialize/test.yaml +4 -0
- data/smoke/integer/a.rb +0 -7
- data/smoke/integer/test.yaml +66 -0
- data/smoke/interface/a.rb +0 -2
- data/smoke/interface/test.yaml +16 -0
- data/smoke/kwbegin/a.rb +0 -1
- data/smoke/kwbegin/test.yaml +14 -0
- data/smoke/lambda/a.rb +1 -4
- data/smoke/lambda/test.yaml +28 -0
- data/smoke/literal/a.rb +0 -5
- data/smoke/literal/b.rb +0 -2
- data/smoke/literal/test.yaml +79 -0
- data/smoke/map/test.yaml +4 -0
- data/smoke/method/a.rb +0 -5
- data/smoke/method/b.rb +0 -1
- data/smoke/method/test.yaml +71 -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.yaml +51 -0
- data/smoke/regexp/a.rb +0 -38
- data/smoke/regexp/b.rb +0 -26
- data/smoke/regexp/test.yaml +372 -0
- data/smoke/regression/set_divide.rb +0 -4
- data/smoke/regression/test.yaml +38 -0
- data/smoke/rescue/a.rb +0 -5
- data/smoke/rescue/test.yaml +60 -0
- data/smoke/self/a.rb +0 -2
- data/smoke/self/test.yaml +16 -0
- data/smoke/skip/skip.rb +0 -2
- data/smoke/skip/test.yaml +16 -0
- data/smoke/stdout/test.yaml +4 -0
- data/smoke/super/a.rb +0 -4
- data/smoke/super/test.yaml +52 -0
- data/smoke/toplevel/a.rb +0 -1
- data/smoke/toplevel/test.yaml +12 -0
- data/smoke/tsort/a.rb +0 -3
- data/smoke/tsort/test.yaml +32 -0
- data/smoke/type_case/a.rb +0 -4
- data/smoke/type_case/test.yaml +33 -0
- data/smoke/yield/a.rb +0 -3
- data/smoke/yield/b.rb +6 -0
- data/smoke/yield/test.yaml +49 -0
- data/steep.gemspec +3 -3
- metadata +108 -17
- data/bin/smoke_runner.rb +0 -139
- data/lib/steep/drivers/signature_error_printer.rb +0 -25
- data/lib/steep/errors.rb +0 -594
- data/lib/steep/signature/errors.rb +0 -128
- data/lib/steep/type_assignability.rb +0 -367
data/smoke/class/a.rb
CHANGED
@@ -5,13 +5,11 @@ class A
|
|
5
5
|
end
|
6
6
|
|
7
7
|
# A#bar is defined but the implementation is incompatible.
|
8
|
-
# !expects MethodArityMismatch: method=bar
|
9
8
|
def bar(y)
|
10
9
|
y
|
11
10
|
end
|
12
11
|
|
13
12
|
# Object#to_s is defined but the implementation is incompatible.
|
14
|
-
# !expects MethodBodyTypeMismatch: method=to_s, expected=::String, actual=::Integer
|
15
13
|
def to_s
|
16
14
|
3
|
17
15
|
end
|
@@ -21,7 +19,6 @@ class A
|
|
21
19
|
5
|
22
20
|
end
|
23
21
|
|
24
|
-
# !expects MethodBodyTypeMismatch: method=self.baz, expected=::Integer, actual=::String
|
25
22
|
def self.baz
|
26
23
|
"baz"
|
27
24
|
end
|
data/smoke/class/c.rb
CHANGED
data/smoke/class/f.rb
CHANGED
data/smoke/class/g.rb
CHANGED
data/smoke/class/i.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
class IncompatibleChild
|
2
2
|
def foo(arg)
|
3
3
|
# @type var x: Symbol
|
4
|
-
# !expects IncompatibleAssignment: lhs_type=::Symbol, rhs_type=::Integer
|
5
4
|
x = super()
|
6
5
|
|
7
6
|
"123"
|
8
7
|
end
|
9
8
|
|
10
9
|
def initialize()
|
11
|
-
# !expects IncompatibleArguments: receiver=::IncompatibleChild, method_type=(name: ::String) -> untyped
|
12
10
|
super()
|
13
11
|
|
14
12
|
super
|
@@ -0,0 +1,89 @@
|
|
1
|
+
---
|
2
|
+
test:
|
3
|
+
a.rb:
|
4
|
+
diagnostics:
|
5
|
+
- |
|
6
|
+
a.rb:8:9: [error] Method parameters are incompatible with declaration `() -> ::String`
|
7
|
+
│ Diagnostic ID: Ruby::MethodArityMismatch
|
8
|
+
│
|
9
|
+
└ def bar(y)
|
10
|
+
~~~
|
11
|
+
- |
|
12
|
+
a.rb:13:2: [error] Cannot allow method body have type `::Integer` because declared as type `::String`
|
13
|
+
│ ::Integer <: ::String
|
14
|
+
│ ::Numeric <: ::String
|
15
|
+
│ ::Object <: ::String
|
16
|
+
│ ::BasicObject <: ::String
|
17
|
+
│
|
18
|
+
│ Diagnostic ID: Ruby::MethodBodyTypeMismatch
|
19
|
+
│
|
20
|
+
└ def to_s
|
21
|
+
~~~~~~~~
|
22
|
+
- |
|
23
|
+
a.rb:22:2: [error] Cannot allow method body have type `::String` because declared as type `::Integer`
|
24
|
+
│ ::String <: ::Integer
|
25
|
+
│ ::Object <: ::Integer
|
26
|
+
│ ::BasicObject <: ::Integer
|
27
|
+
│
|
28
|
+
│ Diagnostic ID: Ruby::MethodBodyTypeMismatch
|
29
|
+
│
|
30
|
+
└ def self.baz
|
31
|
+
~~~~~~~~~~~~
|
32
|
+
b.rb:
|
33
|
+
diagnostics: []
|
34
|
+
c.rb:
|
35
|
+
diagnostics:
|
36
|
+
- |
|
37
|
+
c.rb:1:6: [error] @dynamic annotation contains unknown method name `type`
|
38
|
+
│ Diagnostic ID: Ruby::UnexpectedDynamicMethod
|
39
|
+
│
|
40
|
+
└ class B
|
41
|
+
~
|
42
|
+
f.rb:
|
43
|
+
diagnostics:
|
44
|
+
- |
|
45
|
+
f.rb:9:0: [error] Cannot assign a value of type `::_E` to a variable of type `::D`
|
46
|
+
│ ::_E <: ::D
|
47
|
+
│
|
48
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
49
|
+
│
|
50
|
+
└ d = e
|
51
|
+
~~~~~
|
52
|
+
g.rb:
|
53
|
+
diagnostics:
|
54
|
+
- |
|
55
|
+
g.rb:1:6: [error] Cannot find implementation of method `::B#name`
|
56
|
+
│ Diagnostic ID: Ruby::MethodDefinitionMissing
|
57
|
+
│
|
58
|
+
└ class B
|
59
|
+
~
|
60
|
+
- |
|
61
|
+
g.rb:4:6: [error] Cannot find implementation of method `::B#name`
|
62
|
+
│ Diagnostic ID: Ruby::MethodDefinitionMissing
|
63
|
+
│
|
64
|
+
└ class C
|
65
|
+
~
|
66
|
+
h.rb:
|
67
|
+
diagnostics: []
|
68
|
+
i.rb:
|
69
|
+
diagnostics:
|
70
|
+
- |
|
71
|
+
i.rb:4:4: [error] Cannot assign a value of type `::Integer` to a variable of type `::Symbol`
|
72
|
+
│ ::Integer <: ::Symbol
|
73
|
+
│ ::Numeric <: ::Symbol
|
74
|
+
│ ::Object <: ::Symbol
|
75
|
+
│ ::BasicObject <: ::Symbol
|
76
|
+
│
|
77
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
78
|
+
│
|
79
|
+
└ x = super()
|
80
|
+
~~~~~~~~~~~
|
81
|
+
- |
|
82
|
+
i.rb:10:4: [error] Cannot find method `initialize` of type `::IncompatibleChild` with compatible arity
|
83
|
+
│ Method types:
|
84
|
+
│ def initialize: (name: ::String) -> untyped
|
85
|
+
│
|
86
|
+
│ Diagnostic ID: Ruby::IncompatibleArguments
|
87
|
+
│
|
88
|
+
└ super()
|
89
|
+
~~~~~~~
|
data/smoke/const/a.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# @type const A: Integer
|
2
2
|
# @type var x: String
|
3
3
|
|
4
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
5
4
|
x = A
|
6
5
|
|
7
6
|
x = B
|
@@ -12,7 +11,6 @@ module X
|
|
12
11
|
def foo
|
13
12
|
# @type var x: String
|
14
13
|
|
15
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
16
14
|
x = A
|
17
15
|
|
18
16
|
x = B
|
@@ -22,7 +20,6 @@ end
|
|
22
20
|
|
23
21
|
# @type const Foo::Bar::Baz: Integer
|
24
22
|
|
25
|
-
# !expects IncompatibleAssignment: lhs_type=::String, rhs_type=::Integer
|
26
23
|
x = Foo::Bar::Baz
|
27
24
|
|
28
25
|
z = Foo
|
data/smoke/const/b.rb
ADDED
data/smoke/const/b.rbs
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
---
|
2
|
+
test:
|
3
|
+
a.rb:
|
4
|
+
diagnostics:
|
5
|
+
- |
|
6
|
+
a.rb:4:0: [error] Cannot assign a value of type `::Integer` to a variable of type `::String`
|
7
|
+
│ ::Integer <: ::String
|
8
|
+
│ ::Numeric <: ::String
|
9
|
+
│ ::Object <: ::String
|
10
|
+
│ ::BasicObject <: ::String
|
11
|
+
│
|
12
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
13
|
+
│
|
14
|
+
└ x = A
|
15
|
+
~~~~~
|
16
|
+
- |
|
17
|
+
a.rb:6:4: [error] Cannot detect the type of the expression
|
18
|
+
│ Diagnostic ID: Ruby::FallbackAny
|
19
|
+
│
|
20
|
+
└ x = B
|
21
|
+
~
|
22
|
+
- |
|
23
|
+
a.rb:8:7: [error] Cannot detect the type of the expression
|
24
|
+
│ Diagnostic ID: Ruby::FallbackAny
|
25
|
+
│
|
26
|
+
└ module X
|
27
|
+
~
|
28
|
+
- |
|
29
|
+
a.rb:14:4: [error] Cannot assign a value of type `::Integer` to a variable of type `::String`
|
30
|
+
│ ::Integer <: ::String
|
31
|
+
│ ::Numeric <: ::String
|
32
|
+
│ ::Object <: ::String
|
33
|
+
│ ::BasicObject <: ::String
|
34
|
+
│
|
35
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
36
|
+
│
|
37
|
+
└ x = A
|
38
|
+
~~~~~
|
39
|
+
- |
|
40
|
+
a.rb:16:8: [error] Cannot detect the type of the expression
|
41
|
+
│ Diagnostic ID: Ruby::FallbackAny
|
42
|
+
│
|
43
|
+
└ x = B
|
44
|
+
~
|
45
|
+
- |
|
46
|
+
a.rb:23:0: [error] Cannot assign a value of type `::Integer` to a variable of type `::String`
|
47
|
+
│ ::Integer <: ::String
|
48
|
+
│ ::Numeric <: ::String
|
49
|
+
│ ::Object <: ::String
|
50
|
+
│ ::BasicObject <: ::String
|
51
|
+
│
|
52
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
53
|
+
│
|
54
|
+
└ x = Foo::Bar::Baz
|
55
|
+
~~~~~~~~~~~~~~~~~
|
56
|
+
- |
|
57
|
+
a.rb:26:4: [error] Cannot detect the type of the expression
|
58
|
+
│ Diagnostic ID: Ruby::FallbackAny
|
59
|
+
│
|
60
|
+
└ x = z::Bar::Baz
|
61
|
+
~~~~~~
|
62
|
+
- |
|
63
|
+
a.rb:26:4: [error] Cannot detect the type of the expression
|
64
|
+
│ Diagnostic ID: Ruby::FallbackAny
|
65
|
+
│
|
66
|
+
└ x = z::Bar::Baz
|
67
|
+
~~~~~~~~~~~
|
68
|
+
- |
|
69
|
+
a.rb:27:0: [error] Cannot assign a value of type `::Integer` to a variable of type `::String`
|
70
|
+
│ ::Integer <: ::String
|
71
|
+
│ ::Numeric <: ::String
|
72
|
+
│ ::Object <: ::String
|
73
|
+
│ ::BasicObject <: ::String
|
74
|
+
│
|
75
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
76
|
+
│
|
77
|
+
└ x = ::Foo::Bar::Baz
|
78
|
+
~~~~~~~~~~~~~~~~~~~
|
79
|
+
b.rb:
|
80
|
+
diagnostics:
|
81
|
+
- |
|
82
|
+
b.rb:3:4: [error] Cannot assign a value of type `::String` to a constant of type `::Integer`
|
83
|
+
│ ::String <: ::Integer
|
84
|
+
│ ::Object <: ::Integer
|
85
|
+
│ ::BasicObject <: ::Integer
|
86
|
+
│
|
87
|
+
│ Diagnostic ID: Ruby::IncompatibleAssignment
|
88
|
+
│
|
89
|
+
└ Baz = "Hello"
|
90
|
+
~~~~~~~~~~~~~
|
91
|
+
- |
|
92
|
+
b.rb:5:4: [error] Cannot find the declaration of constant `Baz2`
|
93
|
+
│ Diagnostic ID: Ruby::UnknownConstantAssigned
|
94
|
+
│
|
95
|
+
└ Baz2 = "World"
|
96
|
+
~~~~
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class DuplicatedMethodDefinitionError
|
2
|
+
def foo: () -> void
|
3
|
+
def foo: () -> Integer
|
4
|
+
|
5
|
+
interface _Hello
|
6
|
+
def f: () -> void
|
7
|
+
|
8
|
+
def f: () -> void
|
9
|
+
end
|
10
|
+
|
11
|
+
interface _A
|
12
|
+
def g: () -> void
|
13
|
+
end
|
14
|
+
|
15
|
+
class A
|
16
|
+
include _A
|
17
|
+
|
18
|
+
def g: () -> String
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
---
|
2
|
+
test:
|
3
|
+
duplicated-method-definition.rbs:
|
4
|
+
diagnostics:
|
5
|
+
- |
|
6
|
+
duplicated-method-definition.rbs:2:2: [error] Non-overloading method definition of `foo` in `::DuplicatedMethodDefinitionError` cannot be duplicated
|
7
|
+
│ Diagnostic ID: Ruby::DuplicatedMethodDefinition
|
8
|
+
│
|
9
|
+
└ def foo: () -> void
|
10
|
+
~~~~~~~~~~~~~~~~~~~
|
11
|
+
- |
|
12
|
+
duplicated-method-definition.rbs:18:4: [error] Non-overloading method definition of `g` in `::DuplicatedMethodDefinitionError::A` cannot be duplicated
|
13
|
+
│ Diagnostic ID: Ruby::DuplicatedMethodDefinition
|
14
|
+
│
|
15
|
+
└ def g: () -> String
|
16
|
+
~~~~~~~~~~~~~~~~~~~
|
17
|
+
- |
|
18
|
+
duplicated-method-definition.rbs:6:4: [error] Non-overloading method definition of `f` in `::DuplicatedMethodDefinitionError::_Hello` cannot be duplicated
|
19
|
+
│ Diagnostic ID: Ruby::DuplicatedMethodDefinition
|
20
|
+
│
|
21
|
+
└ def f: () -> void
|
22
|
+
~~~~~~~~~~~~~~~~~
|
23
|
+
generic-parameter-mismatch.rbs:
|
24
|
+
diagnostics:
|
25
|
+
- |
|
26
|
+
generic-parameter-mismatch.rbs:5:2: [error] Different generic parameters are specified across definitions of `::GenericParameterMismatchError::Foo`
|
27
|
+
│ Diagnostic ID: Ruby::GenericParameterMismatch
|
28
|
+
│
|
29
|
+
└ class Foo[A, B]
|
30
|
+
~~~~~~~~~~~~~~~
|
31
|
+
invalid-method-overload.rbs:
|
32
|
+
diagnostics:
|
33
|
+
- |
|
34
|
+
invalid-method-overload.rbs:2:2: [error] Cannot find a non-overloading definition of `foo` in `::InvalidMethodOverload`
|
35
|
+
│ Diagnostic ID: Ruby::InvalidMethodOverload
|
36
|
+
│
|
37
|
+
└ def foo: () -> void | ...
|
38
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~
|
39
|
+
invalid-type-application.rbs:
|
40
|
+
diagnostics:
|
41
|
+
- |
|
42
|
+
invalid-type-application.rbs:2:13: [error] Type `::Integer` is not generic but used as a generic type with 1 arguments
|
43
|
+
│ Diagnostic ID: Ruby::InvalidTypeApplication
|
44
|
+
│
|
45
|
+
└ type foo = Integer[3]
|
46
|
+
~~~~~~~~~~
|
47
|
+
- |
|
48
|
+
invalid-type-application.rbs:4:13: [error] Type `::Array` expects 1 arguments, but 2 arguments are given
|
49
|
+
│ Diagnostic ID: Ruby::InvalidTypeApplication
|
50
|
+
│
|
51
|
+
└ type bar = Array[1, 2]
|
52
|
+
~~~~~~~~~~~
|
53
|
+
- |
|
54
|
+
invalid-type-application.rbs:6:13: [error] Type `::Hash` is generic but used as a non generic type
|
55
|
+
│ Diagnostic ID: Ruby::InvalidTypeApplication
|
56
|
+
│
|
57
|
+
└ type baz = Hash
|
58
|
+
~~~~
|
59
|
+
invalid_variance_annotation.rbs:
|
60
|
+
diagnostics:
|
61
|
+
- |
|
62
|
+
invalid_variance_annotation.rbs:2:11: [error] The variance of type parameter `A` is covariant, but used in incompatible position here
|
63
|
+
│ Diagnostic ID: Ruby::InvalidVarianceAnnotation
|
64
|
+
│
|
65
|
+
└ def foo: (A) -> void
|
66
|
+
~~~~~~~~~~~
|
67
|
+
recursive-alias.rbs:
|
68
|
+
diagnostics:
|
69
|
+
- |
|
70
|
+
recursive-alias.rbs:2:2: [error] Circular method alias is detected in `::RecursiveAlias`: foo -> bar -> baz
|
71
|
+
│ Diagnostic ID: Ruby::RecursiveAlias
|
72
|
+
│
|
73
|
+
└ alias foo bar
|
74
|
+
~~~~~~~~~~~~~
|
75
|
+
recursive-class.rbs:
|
76
|
+
diagnostics:
|
77
|
+
- |
|
78
|
+
recursive-class.rbs:1:0: [error] Circular inheritance/mix-in is detected: ::Foo <: ::Bar <: ::Baz <: ::Foo
|
79
|
+
│ Diagnostic ID: Ruby::RecursiveAncestor
|
80
|
+
│
|
81
|
+
└ class Foo < Bar
|
82
|
+
~~~~~~~~~~~~~~~
|
83
|
+
- |
|
84
|
+
recursive-class.rbs:4:0: [error] Circular inheritance/mix-in is detected: ::Bar <: ::Baz <: ::Foo <: ::Bar
|
85
|
+
│ Diagnostic ID: Ruby::RecursiveAncestor
|
86
|
+
│
|
87
|
+
└ class Bar < Baz
|
88
|
+
~~~~~~~~~~~~~~~
|
89
|
+
- |
|
90
|
+
recursive-class.rbs:7:0: [error] Circular inheritance/mix-in is detected: ::Baz <: ::Foo <: ::Bar <: ::Baz
|
91
|
+
│ Diagnostic ID: Ruby::RecursiveAncestor
|
92
|
+
│
|
93
|
+
└ class Baz < Foo
|
94
|
+
~~~~~~~~~~~~~~~
|
95
|
+
superclass-mismatch.rbs:
|
96
|
+
diagnostics:
|
97
|
+
- |
|
98
|
+
superclass-mismatch.rbs:2:2: [error] Different superclasses are specified for `::SuperclassMismatch::Foo`
|
99
|
+
│ Diagnostic ID: Ruby::SuperclassMismatch
|
100
|
+
│
|
101
|
+
└ class Foo < String
|
102
|
+
~~~~~~~~~~~~~~~~~~
|
103
|
+
unknown-method-alias.rbs:
|
104
|
+
diagnostics:
|
105
|
+
- |
|
106
|
+
unknown-method-alias.rbs:2:2: [error] Cannot find the original method `bar` in `::UnknownMethodAlias`
|
107
|
+
│ Diagnostic ID: Ruby::UnknownMethodAlias
|
108
|
+
│
|
109
|
+
└ alias foo bar
|
110
|
+
~~~~~~~~~~~~~
|
111
|
+
unknown-type-name.rbs:
|
112
|
+
diagnostics:
|
113
|
+
- |
|
114
|
+
unknown-type-name.rbs:6:2: [error] Cannot find type `World`
|
115
|
+
│ Diagnostic ID: Ruby::UnknownTypeName
|
116
|
+
│
|
117
|
+
└ include World
|
118
|
+
~~~~~~~~~~~~~
|
119
|
+
- |
|
120
|
+
unknown-type-name.rbs:8:2: [error] Cannot find type `ABC`
|
121
|
+
│ Diagnostic ID: Ruby::UnknownTypeName
|
122
|
+
│
|
123
|
+
└ class Foo < ABC
|
124
|
+
~~~~~~~~~~~~~~~
|
125
|
+
- |
|
126
|
+
unknown-type-name.rbs:11:15: [error] Cannot find type `ZZZ`
|
127
|
+
│ Diagnostic ID: Ruby::UnknownTypeName
|
128
|
+
│
|
129
|
+
└ module Bar : ZZZ
|
130
|
+
~~~
|
131
|
+
- |
|
132
|
+
unknown-type-name.rbs:4:9: [error] Cannot find type `::World`
|
133
|
+
│ Diagnostic ID: Ruby::UnknownTypeName
|
134
|
+
│
|
135
|
+
└ Hello: World
|
136
|
+
~~~~~
|
137
|
+
- |
|
138
|
+
unknown-type-name.rbs:2:13: [error] Cannot find type `::bar`
|
139
|
+
│ Diagnostic ID: Ruby::UnknownTypeName
|
140
|
+
│
|
141
|
+
└ type foo = bar
|
142
|
+
~~~
|