Skip to content

Commit

Permalink
Fix output tests
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Oct 8, 2024
1 parent ae692e3 commit 8e3672a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
46 changes: 37 additions & 9 deletions smoke/array/test_expectations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
| (::Range[(::Integer | nil)], ::Array[::Integer]) -> ::Array[::Integer]
| (::Range[(::Integer | nil)], nil) -> nil
code: Ruby::UnresolvedOverloading
- range:
start:
line: 9
character: 0
end:
line: 9
character: 8
severity: ERROR
message: |-
Cannot assign a value of type `(::Integer | nil)` to a variable of type `::Integer`
(::Integer | nil) <: ::Integer
nil <: ::Integer
code: Ruby::IncompatibleAssignment
- range:
start:
line: 12
Expand All @@ -29,11 +42,25 @@
character: 8
severity: ERROR
message: |-
Cannot assign a value of type `::Integer` to a variable of type `::String`
::Integer <: ::String
::Numeric <: ::String
::Object <: ::String
::BasicObject <: ::String
Cannot assign a value of type `(::Integer | nil)` to a variable of type `::String`
(::Integer | nil) <: ::String
::Integer <: ::String
::Numeric <: ::String
::Object <: ::String
::BasicObject <: ::String
code: Ruby::IncompatibleAssignment
- range:
start:
line: 17
character: 0
end:
line: 17
character: 8
severity: ERROR
message: |-
Cannot assign a value of type `(::String | nil)` to a variable of type `::String`
(::String | nil) <: ::String
nil <: ::String
code: Ruby::IncompatibleAssignment
- range:
start:
Expand All @@ -44,10 +71,11 @@
character: 8
severity: ERROR
message: |-
Cannot assign a value of type `::String` to a variable of type `::Integer`
::String <: ::Integer
::Object <: ::Integer
::BasicObject <: ::Integer
Cannot assign a value of type `(::String | nil)` to a variable of type `::Integer`
(::String | nil) <: ::Integer
::String <: ::Integer
::Object <: ::Integer
::BasicObject <: ::Integer
code: Ruby::IncompatibleAssignment
- file: b.rb
diagnostics:
Expand Down
2 changes: 1 addition & 1 deletion smoke/block/test_expectations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@
line: 11
character: 5
severity: ERROR
message: Type `(::Integer | ::String)` does not have method `foo`
message: Type `(::Integer | ::String | nil)` does not have method `foo`
code: Ruby::NoMethod
2 changes: 1 addition & 1 deletion smoke/hash/test_expectations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
line: 10
character: 37
severity: ERROR
message: Type `(::Integer | ::String)` does not have method `abcdefg`
message: Type `(::Integer | ::String | nil)` does not have method `abcdefg`
code: Ruby::NoMethod
- file: d.rb
diagnostics:
Expand Down
2 changes: 1 addition & 1 deletion smoke/tsort/a.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# @type var each_node: ^() { (Integer) -> void } -> void
each_node = -> (&b) { g.each_key(&b) }
# @type var each_child: ^(Integer) { (Integer) -> void } -> void
each_child = -> (n, &b) { g[n].each(&b) }
each_child = -> (n, &b) { g[n]&.each(&b) }

# @type var xs: Array[Integer]
xs = TSort.tsort(each_node, each_child)

0 comments on commit 8e3672a

Please sign in to comment.