--- test: a.rb: diagnostics: - | a.rb:8:0: [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 │ └ s = a.foo ~~~~~~~~~ - | a.rb:10:0: [error] Cannot assign a value of type `::String` to a variable of type `::Integer` │ ::String <: ::Integer │ ::Object <: ::Integer │ ::BasicObject <: ::Integer │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ i = a.foo { nil } ~~~~~~~~~~~~~~~~~ b.rb: diagnostics: - | b.rb:5:2: [error] Cannot break with a value of type `::Integer` because type `::Symbol` is assumed │ ::Integer <: ::Symbol │ ::Numeric <: ::Symbol │ ::Object <: ::Symbol │ ::BasicObject <: ::Symbol │ │ Diagnostic ID: Ruby::BreakTypeMismatch │ └ break 3 ~~~~~~~ - | b.rb:10:0: [error] Cannot assign a value of type `(::Integer | ::Symbol)` to a variable of type `::String` │ (::Integer | ::Symbol) <: ::String │ ::Integer <: ::String │ ::Numeric <: ::String │ ::Object <: ::String │ ::BasicObject <: ::String │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ s = a.bar do |x| ~~~~~~~~~~~~~~~~ c.rb: diagnostics: [] d.rb: diagnostics: - | d.rb:6:0: [error] Cannot assign a value of type `::Array[::String]` to a variable of type `::Array[::Float]` │ ::Array[::String] <: ::Array[::Float] │ ::String <: ::Float │ ::Object <: ::Float │ ::BasicObject <: ::Float │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ b = [1,2,3].map(&a) ~~~~~~~~~~~~~~~~~~~ - | d.rb:8:0: [error] Cannot assign a value of type `::Array[::String]` to a variable of type `::Array[::Float]` │ ::Array[::String] <: ::Array[::Float] │ ::String <: ::Float │ ::Object <: ::Float │ ::BasicObject <: ::Float │ │ Diagnostic ID: Ruby::IncompatibleAssignment │ └ b = [1,2,3].map(&:to_s) ~~~~~~~~~~~~~~~~~~~~~~~ - | d.rb:10:0: [error] Cannot find compatible overloading of method `map` of type `::Array[::Integer]` │ Method types: │ def map: [U] () { (::Integer) -> U } -> ::Array[U] │ | () -> ::Enumerator[::Integer, ::Array[untyped]] │ │ Diagnostic ID: Ruby::UnresolvedOverloading │ └ [1,2,3].map(&:no_such_method) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - | d.rb:11:0: [error] Cannot find compatible overloading of method `map` of type `::Array[::Integer]` │ Method types: │ def map: [U] () { (::Integer) -> U } -> ::Array[U] │ | () -> ::Enumerator[::Integer, ::Array[untyped]] │ │ Diagnostic ID: Ruby::UnresolvedOverloading │ └ [1,2,3].map(&:divmod) ~~~~~~~~~~~~~~~~~~~~~