summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala6
-rw-r--r--test/files/pos/bug758.scala7
2 files changed, 10 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index dcee294bb2..0f101322b4 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1897,9 +1897,6 @@ trait Types requires SymbolTable {
res1 <:< res2.substSym(tparams2, tparams1))
case Pair(TypeBounds(lo1, hi1), TypeBounds(lo2, hi2)) =>
lo2 <:< lo1 && hi1 <:< hi2
- case Pair(_, TypeRef(pre2, sym2, args2))
- if sym2.isAbstractType && !(tp2 =:= tp2.bounds.lo) && (tp1 <:< tp2.bounds.lo) =>
- true
case Pair(BoundedWildcardType(bounds), _) =>
bounds.lo <:< tp2
case Pair(_, BoundedWildcardType(bounds)) =>
@@ -1910,6 +1907,9 @@ trait Types requires SymbolTable {
case Pair(TypeVar(_, constr1), _) =>
if (constr1.inst != NoType) constr1.inst <:< tp2
else { constr1.hibounds = tp2 :: constr1.hibounds; true }
+ case Pair(_, TypeRef(pre2, sym2, args2))
+ if sym2.isAbstractType && !(tp2 =:= tp2.bounds.lo) && (tp1 <:< tp2.bounds.lo) =>
+ true
case Pair(_, RefinedType(parents2, ref2)) =>
(parents2 forall tp1.<:<) && (ref2.toList forall tp1.specializes) &&
(!parents2.exists(.symbol.isAbstractType) || tp1.symbol != AllRefClass)
diff --git a/test/files/pos/bug758.scala b/test/files/pos/bug758.scala
new file mode 100644
index 0000000000..160bf37172
--- /dev/null
+++ b/test/files/pos/bug758.scala
@@ -0,0 +1,7 @@
+trait A { type T; type M >: T }
+trait B extends A {
+ val x : String;
+ val u : A { type T = B.this.T } ;
+ type T = x.type;
+ type M = u.M
+}