--- test: a.rb: diagnostics: - | a.rb:6:2: [error] Cannot assign a value of type `::Integer` to a variable of type `::String` │ ::Integer <: ::String │ ::Numeric <: ::String │ ::Object <: ::String │ ::BasicObject <: ::String │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ z = x ~~~~~ - | a.rb:8:2: [error] Cannot assign a value of type `::Integer` to a variable of type `::String` │ ::Integer <: ::String │ ::Numeric <: ::String │ ::Object <: ::String │ ::BasicObject <: ::String │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ z = y ~~~~~ - | a.rb:3:0: [error] Cannot allow method body have type `::Integer` because declared as type `::String` │ ::Integer <: ::String │ ::Numeric <: ::String │ ::Object <: ::String │ ::BasicObject <: ::String │ │ Diagnostic ID: Ruby::MethodBodyTypeMismatch │ └ def foo(x, y:) ~~~~~~~~~~~~~~ - | a.rb:15:7: [error] Method parameters are incompatible with declaration `(::Integer) -> ::String` │ Diagnostic ID: Ruby::MethodArityMismatch │ └ def bar(x, y) ~~~~~~ - | a.rb:18:2: [error] Cannot assign a value of type `::Integer` to a variable of type `::String` │ ::Integer <: ::String │ ::Numeric <: ::String │ ::Object <: ::String │ ::BasicObject <: ::String │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ z = x ~~~~~ b.rb: diagnostics: - | b.rb:4:2: [error] Cannot allow method body have type `::Symbol` because declared as type `(::Integer | ::String)` │ ::Symbol <: (::Integer | ::String) │ ::Symbol <: ::Integer │ ::Object <: ::Integer │ ::BasicObject <: ::Integer │ │ Diagnostic ID: Ruby::MethodBodyTypeMismatch │ └ def foo(x) ~~~~~~~~~~ c.rb: diagnostics: [] d.rb: diagnostics: []