File tree 2 files changed +12
-2
lines changed
src/dotty/tools/dotc/transform
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class ResolveSuper extends MiniPhaseTransform with IdentityDenotTransformer { th
83
83
def methodOverrides (mixin : ClassSymbol ): List [Tree ] = {
84
84
def isOverridden (meth : Symbol ) = meth.overridingSymbol(cls).is(Method , butNot = Deferred )
85
85
def needsDisambiguation (meth : Symbol ): Boolean =
86
- meth.is(Method , butNot = PrivateOrDeferred ) &&
86
+ meth.is(Method , butNot = PrivateOrAccessorOrDeferred ) &&
87
87
! isOverridden(meth) &&
88
88
! meth.allOverriddenSymbols.forall(_ is Deferred )
89
89
for (meth <- mixin.info.decls.toList if needsDisambiguation(meth))
@@ -107,5 +107,5 @@ class ResolveSuper extends MiniPhaseTransform with IdentityDenotTransformer { th
107
107
else ddef
108
108
}
109
109
110
- private val PrivateOrDeferred = Private | Deferred
110
+ private val PrivateOrAccessorOrDeferred = Private | Accessor | Deferred
111
111
}
Original file line number Diff line number Diff line change @@ -6,22 +6,32 @@ import store._
6
6
7
7
trait A {
8
8
str += " a"
9
+ val i = 2
9
10
val s = str += 'A'
10
11
str += '1'
11
12
}
12
13
13
14
trait B extends A {
14
15
str += 'b'
16
+ override val i = 3
15
17
override val s = str += 'B'
16
18
str += '2'
17
19
}
18
20
19
21
class D (sup : Unit ) extends A {
20
22
str += 'd'
23
+ override val i = 4
21
24
override val s = str += 'D'
22
25
str += '3'
23
26
}
24
27
28
+ class E (sup : Unit ) extends A with B {
29
+ str += 'd'
30
+ override val i = 5
31
+ override val s = str += 'E'
32
+ str += '3'
33
+ }
34
+
25
35
26
36
object Test extends D ({str += " Z" }) with B {
27
37
// should only have 2 fields
You can’t perform that action at this time.
0 commit comments