diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/compiler-asSeenFrom.check | 36 | ||||
-rw-r--r-- | test/files/run/phantomValueClass.check | 1 | ||||
-rw-r--r-- | test/files/run/phantomValueClass.scala | 10 | ||||
-rw-r--r-- | test/files/run/reflect-overload.scala | 16 | ||||
-rw-r--r-- | test/files/run/t4658.check | 12 | ||||
-rw-r--r-- | test/files/run/t4658.scala | 14 |
6 files changed, 54 insertions, 35 deletions
diff --git a/test/files/run/compiler-asSeenFrom.check b/test/files/run/compiler-asSeenFrom.check index f198e61072..96e257d303 100644 --- a/test/files/run/compiler-asSeenFrom.check +++ b/test/files/run/compiler-asSeenFrom.check @@ -187,69 +187,69 @@ class J { D[A1]#J[T4] Z.dZ.J[P] D[A1]#J[P] } class D { // after parser - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD: ll.C[List[T3]] } class D { // after uncurry - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD(): ll.C[List[T3]] } class D { // after erasure - private val cD: ll.C + private[this] val cD: ll.C val cD(): ll.C } object Z { // after parser def kz[P <: ll.Z.dZ.J[ll.A2]]: ll.Z.dZ.J[P] - private val jZ: ll.Z.dZ.J[ll.A2] + private[this] val jZ: ll.Z.dZ.J[ll.A2] val jZ: ll.Z.dZ.J[ll.A2] - private val dZ: ll.D[ll.A1] + private[this] val dZ: ll.D[ll.A1] val dZ: ll.D[ll.A1] } object Z { // after uncurry def kz[P <: ll.Z.dZ.J[ll.A2]](): ll.Z.dZ.J[P] - private val jZ: ll.Z.dZ.J[ll.A2] + private[this] val jZ: ll.Z.dZ.J[ll.A2] val jZ(): ll.Z.dZ.J[ll.A2] - private val dZ: ll.D[ll.A1] + private[this] val dZ: ll.D[ll.A1] val dZ(): ll.D[ll.A1] } object Z { // after erasure def kz(): ll.D#J - private val jZ: ll.D#J + private[this] val jZ: ll.D#J val jZ(): ll.D#J - private val dZ: ll.D + private[this] val dZ: ll.D val dZ(): ll.D } object Z { // after flatten def kz(): ll.D#D$J - private val jZ: ll.D#D$J + private[this] val jZ: ll.D#D$J val jZ(): ll.D#D$J - private val dZ: ll.D + private[this] val dZ: ll.D val dZ(): ll.D } value dZ { // after parser - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD: ll.C[List[T3]] } value dZ { // after parser - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD: ll.C[List[T3]] } value dZ { // after uncurry - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD(): ll.C[List[T3]] } value dZ { // after erasure - private val cD: ll.C + private[this] val cD: ll.C val cD(): ll.C } @@ -307,17 +307,17 @@ method kz { // after parser } value $outer { // after parser - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD: ll.C[List[T3]] } value $outer { // after uncurry - private val cD: ll.C[List[T3]] + private[this] val cD: ll.C[List[T3]] val cD(): ll.C[List[T3]] } value $outer { // after erasure - private val cD: ll.C + private[this] val cD: ll.C val cD(): ll.C } diff --git a/test/files/run/phantomValueClass.check b/test/files/run/phantomValueClass.check new file mode 100644 index 0000000000..323fae03f4 --- /dev/null +++ b/test/files/run/phantomValueClass.check @@ -0,0 +1 @@ +foobar diff --git a/test/files/run/phantomValueClass.scala b/test/files/run/phantomValueClass.scala new file mode 100644 index 0000000000..f6509f2189 --- /dev/null +++ b/test/files/run/phantomValueClass.scala @@ -0,0 +1,10 @@ +final class Phantom[A](val s: String) extends AnyVal { + def compose(p: Phantom[A]): Phantom[A] = new Phantom[A](s+p.s) +} + +object Test extends App { + val x = new Phantom[Int]("foo") + val y = new Phantom[Int]("bar") + val z = x compose y + println(z.s) +} diff --git a/test/files/run/reflect-overload.scala b/test/files/run/reflect-overload.scala new file mode 100644 index 0000000000..af82a1948d --- /dev/null +++ b/test/files/run/reflect-overload.scala @@ -0,0 +1,16 @@ +object Test extends App { + import reflect.mirror._ + + val s = "hello world" + val sc = symbolOfInstance(s) + val st = sc.asType + val m = st member newTermName("indexOf") + val IntType = definitions.IntClass.asType + val indexOf = m resolveOverloaded(actuals = List(IntType)) + assert(invoke(s, indexOf)('w') == 6) + assert((invoke(s, indexOf)('w') match { case x: Int => x }) == 6) + + val m2 = st member newTermName("substring") + val substring = m2 resolveOverloaded(actuals = List(IntType, IntType)) + assert(invoke(s, substring)(2, 6) == "llo ") +} diff --git a/test/files/run/t4658.check b/test/files/run/t4658.check index 743b0faee3..bb6405175e 100644 --- a/test/files/run/t4658.check +++ b/test/files/run/t4658.check @@ -19,8 +19,8 @@ Ranges: -30 -10 IntRanges: -Disabled #1 -Disabled #2 +-1073741824 +-1073741824 0 0 55 @@ -39,8 +39,8 @@ Disabled #2 -30 -10 LongRanges: -Disabled #1 -Disabled #2 +2305843008139952128 +-2305843008139952128 0 0 55 @@ -59,8 +59,8 @@ Disabled #2 -30 -10 BigIntRanges: -Disabled #1 -Disabled #2 +2305843008139952128 +-2305843008139952128 0 0 55 diff --git a/test/files/run/t4658.scala b/test/files/run/t4658.scala index e1799fae9b..8c07c50694 100644 --- a/test/files/run/t4658.scala +++ b/test/files/run/t4658.scala @@ -20,22 +20,14 @@ object Test { def numericBigIntRanges = rangeData.map(r => if (r.inclusive) NumericRange.inclusive(BigInt(r.start), BigInt(r.end), BigInt(r.step)) else NumericRange(BigInt(r.start), BigInt(r.end), BigInt(r.step))) def main(args: Array[String]) { - // We drop the first two tests for all ranges which don't have a decent sum implementation, - // because it is just too slow. println("Ranges:") ranges.foreach{range => println(range.sum)} println("IntRanges:") - println("Disabled #1") - println("Disabled #2") - numericIntRanges.drop(2).foreach{range => println(range.sum)} + numericIntRanges.foreach{range => println(range.sum)} println("LongRanges:") - println("Disabled #1") - println("Disabled #2") - numericLongRanges.drop(2).foreach{range => println(range.sum)} + numericLongRanges.foreach{range => println(range.sum)} println("BigIntRanges:") - println("Disabled #1") - println("Disabled #2") - numericBigIntRanges.drop(2).foreach{range => println(range.sum)} + numericBigIntRanges.foreach{range => println(range.sum)} } }
\ No newline at end of file |