Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Jan 7, 2025
1 parent 62bae76 commit 309f25b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
7 changes: 5 additions & 2 deletions smoke/hash/d.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# @type var params: { name: String, id: Integer }

params = { id: 30, name: "Matz" }
params = { id: 30, name: "Matz", email: "[email protected]" }
params = { id: 30, name: "foo" }

params = { id: "30", name: "foo", email: "[email protected]" }
# @type var params2: { name: String, id: Integer, email: String? }
params2 = { id: 30, name: "Matz", email: "[email protected]" }
params2 = { id: 30, name: "foo" }
21 changes: 9 additions & 12 deletions smoke/hash/test_expectations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,23 @@
diagnostics:
- range:
start:
line: 5
line: 3
character: 0
end:
line: 5
character: 66
line: 3
character: 60
severity: ERROR
message: |-
Cannot assign a value of type `{ ?:email => ::String, :id => ::String, :name => ::String }` to a variable of type `{ :id => ::Integer, :name => ::String }`
{ ?:email => ::String, :id => ::String, :name => ::String } <: { :id => ::Integer, :name => ::String }
::String <: ::Integer
::Object <: ::Integer
::BasicObject <: ::Integer
Cannot assign a value of type `{ ?:email => ::String, :id => ::Integer, :name => ::String }` to a variable of type `{ :id => ::Integer, :name => ::String }`
{ ?:email => ::String, :id => ::Integer, :name => ::String } <: { :id => ::Integer, :name => ::String }
code: Ruby::IncompatibleAssignment
- range:
start:
line: 5
character: 34
line: 3
character: 33
end:
line: 5
character: 39
line: 3
character: 38
severity: ERROR
message: Unknown key `:email` is given to a record type
code: Ruby::UnknownRecordKey
Expand Down

0 comments on commit 309f25b

Please sign in to comment.