File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,20 @@ object OverridingPairs {
40
40
* relative to <base>.this do
41
41
*/
42
42
protected def matches (sym1 : Symbol , sym2 : Symbol ): Boolean =
43
- sym1.isType || sym1.asSeenFrom(self).matches(sym2.asSeenFrom(self))
43
+ // Similar to dotty.tools.dotc.core.Denotations.SingleDenotation.matches
44
+ // But in case MethodNotAMethodMatch, sym2 must not be JavaDefined
45
+ def symMatches =
46
+ val d1 = sym1.asSeenFrom(self)
47
+ val d2 = sym2.asSeenFrom(self)
48
+ import Signature .MatchDegree ._
49
+ d1.signature.matchDegree(d2.signature) match
50
+ case FullMatch => true
51
+ case MethodNotAMethodMatch => ! ctx.erasedTypes && ! d2.symbol.is(JavaDefined )
52
+ case ParamMatch => ! ctx.erasedTypes && d1.info.matches(d2.info)
53
+ case NoMatch => false
54
+
55
+ sym1.isType || symMatches
56
+ end matches
44
57
45
58
/** The symbols that can take part in an overriding pair */
46
59
private val decls = {
You can’t perform that action at this time.
0 commit comments