File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,22 @@ 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 a JavaDefined field
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 NoMatch => false
52
+ case MethodNotAMethodMatch =>
53
+ ! ctx.erasedTypes && ! d2.symbol.is(JavaDefinedVal , butNot = Method )
54
+ case ParamMatch =>
55
+ ! ctx.erasedTypes && d1.info.matches(d2.info)
56
+
57
+ sym1.isType || symMatches
58
+ end matches
44
59
45
60
/** The symbols that can take part in an overriding pair */
46
61
private val decls = {
You can’t perform that action at this time.
0 commit comments