File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -487,9 +487,9 @@ abstract class RefChecks extends Transform {
487
487
warnAdaptedNullaryOverride()
488
488
}
489
489
else if (member.paramLists.isEmpty) {
490
- // NullaryOverrideAdapted is only added to symbols being compiled, so check for a mismatch
491
- // if both symbols are mixed in from the classpath
492
- if (! member.isStable && other.paramLists.nonEmpty && ! exempted)
490
+ // Definitions that directly override get a parameter list and a `NullaryOverrideAdapted` attachment
491
+ // in Namers. Here we also warn when there's a mismatch between two mixed-in members.
492
+ if (! member.isStable && other.paramLists.nonEmpty && ! exempted && ! other.overrides.exists(javaDetermined) )
493
493
warnAdaptedNullaryOverride()
494
494
}
495
495
else if (other.paramLists.isEmpty) {
Original file line number Diff line number Diff line change
1
+ interface A {
2
+ int f ();
3
+ }
Original file line number Diff line number Diff line change
1
+ // scalac: -Werror
2
+
3
+ trait B1 extends A { def f : Int }
4
+ trait C1 { def f = 2 }
5
+ class T1 extends B1 with C1
6
+
7
+ trait B2 extends A { def f : Int = 1 }
8
+ trait C2 { self : B2 => override def f = 2 }
9
+ class T2 extends B2 with C2
You can’t perform that action at this time.
0 commit comments