--- test: a.rb: diagnostics: - | a.rb:7:4: [error] Type `(::Integer | ::String)` does not have method `foobar` │ Diagnostic ID: Ruby::NoMethod │ └ x.foobar() ~~~~~~ - | a.rb:12:4: [error] Type `(::Integer | ::String | ::Symbol)` does not have method `foobar` │ Diagnostic ID: Ruby::NoMethod │ └ x.foobar ~~~~~~ - | a.rb:17:4: [error] Type `1` does not have method `foobar` │ Diagnostic ID: Ruby::NoMethod │ └ x.foobar ~~~~~~ - | a.rb:23:2: [error] Type annotation about `x` is incompatible since ::Integer <: ::String doesn't hold │ ::Integer <: ::String │ ::Numeric <: ::String │ ::Object <: ::String │ ::BasicObject <: ::String │ │ Diagnostic ID: Ruby::IncompatibleAnnotation │ └ x + 1 ~~~~~