Check that the result type of the current method fits the given expected result type.
A type tp
is compatible with a type pt
if one of the following holds:
A type tp
is compatible with a type pt
if one of the following holds:
tp
is a subtype of pt
2. pt
is by name parameter type, and tp
is compatible with its underlying type
3. there is an implicit conversion from tp
to pt
.
4. tp
is a numeric subtype of pt
(this case applies even if implicit conversions are disabled)
Test compatibility after normalization in a fresh typerstate.
A trait defining an
isCompatible
method.