File tree 3 files changed +21
-2
lines changed
compiler/src/dotty/tools/dotc
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -991,7 +991,7 @@ object Types {
991
991
case tp : TypeRef =>
992
992
if (tp.symbol.isClass) tp
993
993
else tp.info match {
994
- case TypeAlias (tp ) => tp .dealias1(keepAnnots): @ tailrec
994
+ case TypeAlias (alias ) => alias .dealias1(keepAnnots): @ tailrec
995
995
case _ => tp
996
996
}
997
997
case app @ AppliedType (tycon, args) =>
Original file line number Diff line number Diff line change @@ -343,7 +343,10 @@ object RefChecks {
343
343
if (autoOverride(member) ||
344
344
other.owner.is(JavaTrait ) && ctx.testScala2Mode(" `override' modifier required when a Java 8 default method is re-implemented" , member.pos))
345
345
member.setFlag(Override )
346
- else if (member.owner != clazz && other.owner != clazz && ! (other.owner derivesFrom member.owner))
346
+ else if (member.isType && self.memberInfo(member) =:= self.memberInfo(other))
347
+ () // OK, don't complain about type aliases which are equal
348
+ else if (member.owner != clazz && other.owner != clazz &&
349
+ ! (other.owner derivesFrom member.owner))
347
350
emitOverrideError(
348
351
clazz + " inherits conflicting members:\n "
349
352
+ infoStringWithLocation(other) + " and\n " + infoStringWithLocation(member)
Original file line number Diff line number Diff line change
1
+ trait A {
2
+ type A_This <: A
3
+ }
4
+ trait B extends A {
5
+ type A_This = B_This
6
+ type B_This <: B
7
+ }
8
+ trait C extends A {
9
+ type A_This = C_This
10
+ type C_This <: C
11
+ }
12
+ trait D extends B with C {
13
+ type B_This = D_This
14
+ type C_This = D_This
15
+ type D_This <: D
16
+ }
You can’t perform that action at this time.
0 commit comments