diff --git a/smoke/hash/d.rb b/smoke/hash/d.rb index 2a3c2f08..15a6d341 100644 --- a/smoke/hash/d.rb +++ b/smoke/hash/d.rb @@ -1,5 +1,8 @@ # @type var params: { name: String, id: Integer } -params = { id: 30, name: "Matz" } +params = { id: 30, name: "Matz", email: "matz@example.com" } +params = { id: 30, name: "foo" } -params = { id: "30", name: "foo", email: "matsumoto@soutaro.com" } +# @type var params2: { name: String, id: Integer, email: String? } +params2 = { id: 30, name: "Matz", email: "matz@example.com" } +params2 = { id: 30, name: "foo" } diff --git a/smoke/hash/test_expectations.yml b/smoke/hash/test_expectations.yml index 08d3be19..78b354f4 100644 --- a/smoke/hash/test_expectations.yml +++ b/smoke/hash/test_expectations.yml @@ -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