File tree 2 files changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -727,8 +727,8 @@ object Types {
727
727
728
728
/** Is this type a legal type for a member that overrides another
729
729
* member of type `that`? This is the same as `<:<`, except that
730
- * the types ()T and => T are identified, and T is seen as overriding
731
- * either type .
730
+ * the types ` ()T`, ` => T` and `T` are seen as overriding
731
+ * each other .
732
732
*/
733
733
final def overrides (that : Type )(implicit ctx : Context ) = {
734
734
def result (tp : Type ): Type = tp match {
@@ -737,7 +737,8 @@ object Types {
737
737
}
738
738
(this frozen_<:< that) || {
739
739
val rthat = result(that)
740
- (rthat ne that) && (result(this ) frozen_<:< rthat)
740
+ val rthis = result(this )
741
+ (rthat.ne(that) || rthis.ne(this )) && (rthis frozen_<:< rthat)
741
742
}
742
743
}
743
744
Original file line number Diff line number Diff line change
1
+ class A [T ](val x : T )
2
+ class B [T ](override val x : T ) extends A [T ](x)
You can’t perform that action at this time.
0 commit comments