From ee24807f8706bb91b9d854eaba39f0ddd9c2a054 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 28 Jan 2013 08:42:27 +0100 Subject: Move a test from pos to run to highlight bytecode deficiencies. We'll address them in subsequent commits. --- test/files/pos/t6259.scala | 47 -------------------------------------- test/files/run/t6259.scala | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 47 deletions(-) delete mode 100644 test/files/pos/t6259.scala create mode 100644 test/files/run/t6259.scala (limited to 'test') diff --git a/test/files/pos/t6259.scala b/test/files/pos/t6259.scala deleted file mode 100644 index 43361c417e..0000000000 --- a/test/files/pos/t6259.scala +++ /dev/null @@ -1,47 +0,0 @@ -package t6259 - -import scala.reflect.runtime.universe._ - -class A[X](implicit val tt: TypeTag[X]) {} -object B extends A[String] - -object C { - object D extends A[String] -} - -trait E { - object F extends A[String] -} - -class G { - object H extends A[String] -} - -object Test { - val x = { - object InVal extends A[String] - 5 - } - -} - -// Note: Both of these fail right now. - -trait NeedsEarly { - val x: AnyRef -} - -object Early extends { - // Drops to this.getClass and is not ok... - val x = { object EarlyOk extends A[String]; EarlyOk } -} with NeedsEarly - - -class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X] - -object DoubleOk extends DoubleTrouble[String]({ - // Drops to this.getClass and is an issue - object InnerTrouble extends A[String]; - InnerTrouble -}) - diff --git a/test/files/run/t6259.scala b/test/files/run/t6259.scala new file mode 100644 index 0000000000..a5a7bf9043 --- /dev/null +++ b/test/files/run/t6259.scala @@ -0,0 +1,56 @@ +import scala.reflect.runtime.universe._ + +class A[X](implicit val tt: TypeTag[X]) {} +object B extends A[String] + +object C { + object D extends A[String] +} + +trait E { + object F extends A[String] +} + +class G { + object H extends A[String] +} + +object HasX { + val x = { + object InVal extends A[String] + InVal + 5 + } + +} + +trait NeedsEarly { + val x: AnyRef +} + +object Early extends { + // Drops to this.getClass and is not ok... + val x = { object EarlyOk extends A[String]; EarlyOk } +} with NeedsEarly + + +class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X] + +object DoubleOk extends DoubleTrouble[String]({ + // Drops to this.getClass and is an issue + object InnerTrouble extends A[String]; + InnerTrouble +}) + +object Test extends App { + B + C.D + val e = new E {}; e.F + val g = new G; g.H + + //locally(HasX.x) TODO sort out VerifyError in HasX$InVal$2$. by accounting for nesting in Namer#inConstructorFlag + // locally(Early.x) TODO sort out VerifyError in Early$. + // DoubleOk TODO sort out VerifyError in DoubleOk$. +} + + -- cgit v1.2.3