File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -516,9 +516,7 @@ object RefChecks {
516516 overrideError(i " needs to be declared with @targetName( ${" \" " }${other.targetName}${" \" " }) so that external names match " )
517517 else
518518 overrideError(" cannot have a @targetName annotation since external names would be different" )
519- else if other.is(ParamAccessor )
520- && ! (member.is(ParamAccessor ) && ParamForwarding .inheritedAccessor(member) == other)
521- then // (1.13)
519+ else if other.is(ParamAccessor ) && ! isInheritedAccessor(member, other) then // (1.13)
522520 if sourceVersion.isAtLeast(`future`) then
523521 overrideError(i " cannot override val parameter ${other.showLocated}" )
524522 else
@@ -531,6 +529,13 @@ object RefChecks {
531529 overrideDeprecation(" " , member, other, " removed or renamed" )
532530 end checkOverride
533531
532+ def isInheritedAccessor (mbr : Symbol , other : Symbol ): Boolean =
533+ mbr.is(ParamAccessor )
534+ && {
535+ val next = ParamForwarding .inheritedAccessor(mbr)
536+ next == other || isInheritedAccessor(next, other)
537+ }
538+
534539 OverridingPairsChecker (clazz, self).checkAll(checkOverride)
535540 printMixinOverrideErrors()
536541
Original file line number Diff line number Diff line change @@ -3,3 +3,16 @@ class B(override val x: Int) extends A(x)
33
44class C (x : Int ) extends A (x)
55case class D (override val x : Int ) extends C (x)
6+
7+ // The following is extracted from akka:
8+ trait LogEvent {
9+ def cause : Throwable
10+ }
11+
12+ /**
13+ * For ERROR Logging
14+ */
15+ case class Error (override val cause : Throwable ) extends LogEvent
16+ class Error2 (override val cause : Throwable ) extends Error (cause)
17+ class Error3 (override val cause : Throwable ) extends Error2 (cause)
18+
You can’t perform that action at this time.
0 commit comments