You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix overriding checks involving Scala and Java methods
To check which methods are in an overriding relationship, we rely on
denotation matching which checks that the methods have matching
signatures, but because Scala and Java have different erasure rules,
seemingly valid overrides might not be seen as such because they end up
with different signatures. To compensate for this we change
SingleDenotation#matchesLoosely to use the Scala signatures of both
methods when comparing a Scala and a Java method. This works even though
the methods end up with different erased types because Erasure will
insert bridges.
Note that even after this change, we cannot simply override a Java
generic `Array[T]` with a Scala `Array[T]`, because we intentionally
parse these Java types as `Array[T & Object]`, see
`TypeApplications.translateJavaArrayElementType` for details and
tests/{neg,pos}/i1747.scala for examples.
0 commit comments