aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala7
-rw-r--r--test/dotc/tests.scala1
-rw-r--r--tests/neg/t1279a.scala (renamed from tests/pos/t1279a.scala)4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index d5153bf13..2024a993e 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -735,7 +735,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
def typedAppliedTypeTree(tree: untpd.AppliedTypeTree)(implicit ctx: Context): AppliedTypeTree = track("typedAppliedTypeTree") {
val tpt1 = typed(tree.tpt)
val args1 = tree.args mapconserve (typed(_))
- // todo in later phase: check arguments conform to parameter bounds
+ // check that arguments conform to bounds is done in phase FirstTransform
assignType(cpy.AppliedTypeTree(tree, tpt1, args1), tpt1, args1)
}
@@ -748,9 +748,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val TypeBoundsTree(lo, hi) = desugar.typeBoundsTree(tree)
val lo1 = typed(lo)
val hi1 = typed(hi)
- // need to do in later phase, as this might cause a cyclic reference error. See pos/t0039.scala
- // if (!(lo1.tpe <:< hi1.tpe))
- // ctx.error(d"lower bound ${lo1.tpe} does not conform to upper bound ${hi1.tpe}", tree.pos)
+ if (!(lo1.tpe <:< hi1.tpe))
+ ctx.error(d"lower bound ${lo1.tpe} does not conform to upper bound ${hi1.tpe}", tree.pos)
assignType(cpy.TypeBoundsTree(tree, lo1, hi1), lo1, hi1)
}
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala
index fa577573a..8bbe30ad8 100644
--- a/test/dotc/tests.scala
+++ b/test/dotc/tests.scala
@@ -84,6 +84,7 @@ class tests extends CompilerTest {
@Test def neg_tailcall = compileFile(negDir, "tailcall/tailrec", xerrors = 7)
@Test def neg_tailcall2 = compileFile(negDir, "tailcall/tailrec-2", xerrors = 2)
@Test def neg_tailcall3 = compileFile(negDir, "tailcall/tailrec-3", xerrors = 2)
+ @Test def nef_t1279a = compileFile(negDir, "t1279a", xerrors = 1)
@Test def neg_t1843 = compileFile(negDir, "t1843", xerrors = 1)
@Test def neg_t1843_variances = compileFile(negDir, "t1843-variances", xerrors = 1)
@Test def neg_t2994 = compileFile(negDir, "t2994", xerrors = 2)
diff --git a/tests/pos/t1279a.scala b/tests/neg/t1279a.scala
index 18b1e53f4..6d768d435 100644
--- a/tests/pos/t1279a.scala
+++ b/tests/neg/t1279a.scala
@@ -1,10 +1,10 @@
// covariant linked list
abstract class M {
- self =>
+ self: M =>
type T
final type selfType = M {type T <: self.T}
- type actualSelfType >: self.type <: selfType
+ type actualSelfType >: self.type <: selfType // this no longer compiles because self.type is not a subtype of selfType
def next: selfType