diff options
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/pos/inference.scala | 20 | ||||
-rw-r--r-- | test/pending/run/t5258a.scala | 2 | ||||
-rw-r--r-- | test/pending/run/t5258b.scala | 2 | ||||
-rw-r--r-- | test/pending/run/t5258c.scala | 2 | ||||
-rw-r--r-- | test/pending/run/t5271_1.check | 0 | ||||
-rw-r--r-- | test/pending/run/t5271_1.scala | 7 | ||||
-rw-r--r-- | test/pending/run/t5271_2.check | 1 | ||||
-rw-r--r-- | test/pending/run/t5271_2.scala | 9 | ||||
-rw-r--r-- | test/pending/run/t5271_3.check | 1 | ||||
-rw-r--r-- | test/pending/run/t5271_3.scala | 10 | ||||
-rw-r--r-- | test/pending/run/t5692.flags | 1 | ||||
-rw-r--r-- | test/pending/run/t5692/Impls_Macros_1.scala | 9 | ||||
-rw-r--r-- | test/pending/run/t5692/Test_2.scala | 4 | ||||
-rw-r--r-- | test/pending/shootout/meteor.scala | 64 |
14 files changed, 62 insertions, 70 deletions
diff --git a/test/pending/pos/inference.scala b/test/pending/pos/inference.scala index d28d003435..3672351fca 100644 --- a/test/pending/pos/inference.scala +++ b/test/pending/pos/inference.scala @@ -1,15 +1,15 @@ // inference illuminator object Test { - class D1[T1 : Manifest, T2 <: T1 : Manifest](x: T1) { println(manifest[(T1, T2)]) } - class D2[T1 : Manifest, T2 >: T1 : Manifest](x: T1) { println(manifest[(T1, T2)]) } - class D3[+T1 : Manifest, T2 <: T1 : Manifest](x: T1) { println(manifest[(T1, T2)]) } - class D4[-T1 : Manifest, T2 >: T1 : Manifest](x: T1) { println(manifest[(T1, T2)]) } - - class E1[T1 : Manifest, T2 <: T1 : Manifest](x: D1[T1, T2]) { println(manifest[(T1, T2)]) } - class E2[T1 : Manifest, T2 >: T1 : Manifest](x: D2[T1, T2]) { println(manifest[(T1, T2)]) } - class E3[+T1 : Manifest, T2 <: T1 : Manifest](x: D3[T1, T2]) { println(manifest[(T1, T2)]) } - class E4[-T1 : Manifest, T2 >: T1 : Manifest](x: D4[T1, T2]) { println(manifest[(T1, T2)]) } - + class D1[T1 : TypeTag, T2 <: T1 : TypeTag](x: T1) { println(typeTag[(T1, T2)]) } + class D2[T1 : TypeTag, T2 >: T1 : TypeTag](x: T1) { println(typeTag[(T1, T2)]) } + class D3[+T1 : TypeTag, T2 <: T1 : TypeTag](x: T1) { println(typeTag[(T1, T2)]) } + class D4[-T1 : TypeTag, T2 >: T1 : TypeTag](x: T1) { println(typeTag[(T1, T2)]) } + + class E1[T1 : TypeTag, T2 <: T1 : TypeTag](x: D1[T1, T2]) { println(typeTag[(T1, T2)]) } + class E2[T1 : TypeTag, T2 >: T1 : TypeTag](x: D2[T1, T2]) { println(typeTag[(T1, T2)]) } + class E3[+T1 : TypeTag, T2 <: T1 : TypeTag](x: D3[T1, T2]) { println(typeTag[(T1, T2)]) } + class E4[-T1 : TypeTag, T2 >: T1 : TypeTag](x: D4[T1, T2]) { println(typeTag[(T1, T2)]) } + def main(args: Array[String]): Unit = { // WHY YOU NO LIKE NOTHING SO MUCH SCALAC? val d1 = new D1(5) diff --git a/test/pending/run/t5258a.scala b/test/pending/run/t5258a.scala index 755d135468..127829c724 100644 --- a/test/pending/run/t5258a.scala +++ b/test/pending/run/t5258a.scala @@ -1,3 +1,5 @@ +import scala.reflect.mirror._ + object Test extends App { reify { println(classOf[Int]) diff --git a/test/pending/run/t5258b.scala b/test/pending/run/t5258b.scala index 8ad1ff114e..82555cde96 100644 --- a/test/pending/run/t5258b.scala +++ b/test/pending/run/t5258b.scala @@ -1,3 +1,5 @@ +import scala.reflect.mirror._ + object Test extends App { reify { class C diff --git a/test/pending/run/t5258c.scala b/test/pending/run/t5258c.scala index 1f76391162..a0a1647486 100644 --- a/test/pending/run/t5258c.scala +++ b/test/pending/run/t5258c.scala @@ -1,3 +1,5 @@ +import scala.reflect.mirror._ + object Test extends App { reify { object E extends Enumeration { val foo, bar = Value } diff --git a/test/pending/run/t5271_1.check b/test/pending/run/t5271_1.check deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/pending/run/t5271_1.check +++ /dev/null diff --git a/test/pending/run/t5271_1.scala b/test/pending/run/t5271_1.scala deleted file mode 100644 index fae64350e3..0000000000 --- a/test/pending/run/t5271_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.mirror._ - -object Test extends App { - reify { - case class C(foo: Int, bar: Int) - }.eval -} diff --git a/test/pending/run/t5271_2.check b/test/pending/run/t5271_2.check deleted file mode 100644 index b8626c4cff..0000000000 --- a/test/pending/run/t5271_2.check +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/test/pending/run/t5271_2.scala b/test/pending/run/t5271_2.scala deleted file mode 100644 index d25e1fe804..0000000000 --- a/test/pending/run/t5271_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.mirror._ - -object Test extends App { - reify { - case class C(foo: Int, bar: Int) - val c = C(2, 2) - println(c.foo * c.bar) - }.eval -} diff --git a/test/pending/run/t5271_3.check b/test/pending/run/t5271_3.check deleted file mode 100644 index f32a5804e2..0000000000 --- a/test/pending/run/t5271_3.check +++ /dev/null @@ -1 +0,0 @@ -true
\ No newline at end of file diff --git a/test/pending/run/t5271_3.scala b/test/pending/run/t5271_3.scala deleted file mode 100644 index 65a03ae323..0000000000 --- a/test/pending/run/t5271_3.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.mirror._ - -object Test extends App { - reify { - object C { def qwe = 4 } - case class C(foo: Int, bar: Int) - val c = C(2, 2) - println(c.foo * c.bar == C.qwe) - }.eval -} diff --git a/test/pending/run/t5692.flags b/test/pending/run/t5692.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/pending/run/t5692.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/pending/run/t5692/Impls_Macros_1.scala b/test/pending/run/t5692/Impls_Macros_1.scala new file mode 100644 index 0000000000..f9c1e5f12b --- /dev/null +++ b/test/pending/run/t5692/Impls_Macros_1.scala @@ -0,0 +1,9 @@ +import scala.reflect.makro.Context + +object Impls { + def impl[A](c: reflect.makro.Context) = c.reify(()) +} + +object Macros { + def decl[A] = macro Impls.impl[A] +}
\ No newline at end of file diff --git a/test/pending/run/t5692/Test_2.scala b/test/pending/run/t5692/Test_2.scala new file mode 100644 index 0000000000..29251a5ef5 --- /dev/null +++ b/test/pending/run/t5692/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + val x = Macros.decl + def y() { Macros.decl(); } +}
\ No newline at end of file diff --git a/test/pending/shootout/meteor.scala b/test/pending/shootout/meteor.scala index 2fd702753a..154695533b 100644 --- a/test/pending/shootout/meteor.scala +++ b/test/pending/shootout/meteor.scala @@ -19,7 +19,7 @@ object meteor { -// Solver.scala +// Solver.scala // import scala.collection.mutable._ final class Solver (n: Int) { @@ -29,8 +29,8 @@ final class Solver (n: Int) { private val board = new Board() - val pieces = Array( - new Piece(0), new Piece(1), new Piece(2), new Piece(3), new Piece(4), + val pieces = Array( + new Piece(0), new Piece(1), new Piece(2), new Piece(3), new Piece(4), new Piece(5), new Piece(6), new Piece(7), new Piece(8), new Piece(9) ) val unplaced = new BitSet(pieces.length) @@ -71,8 +71,8 @@ final class Solver (n: Int) { private def puzzleSolved() = { val b = board.asString - if (first == null){ - first = b; last = b + if (first == null){ + first = b; last = b } else { if (b < first){ first = b } else { if (b > last){ last = b } } } @@ -81,7 +81,7 @@ final class Solver (n: Int) { private def shouldPrune() = { board.unmark - !board.cells.forall(c => c.contiguousEmptyCells % Piece.size == 0) + !board.cells.forall(c => c.contiguousEmptyCells % Piece.size == 0) } @@ -108,8 +108,8 @@ final class Solver (n: Int) { } /* - def printPieces() = - for (i <- Iterator.range(0,Board.pieces)) pieces(i).print + def printPieces() = + for (i <- Iterator.range(0,Board.pieces)) pieces(i).print */ } @@ -126,7 +126,7 @@ object Board { val size = rows * cols } -final class Board { +final class Board { val cells = boardCells() val cellsPieceWillFill = new Array[BoardCell](Piece.size) @@ -134,9 +134,9 @@ final class Board { def unmark() = for (c <- cells) c.unmark - def asString() = - new String( cells map( - c => if (c.piece == null) '-'.toByte + def asString() = + new String( cells map( + c => if (c.piece == null) '-'.toByte else (c.piece.number + 48).toByte )) def firstEmptyCellIndex() = cells.findIndexOf(c => c.isEmpty) @@ -144,13 +144,13 @@ final class Board { def add(pieceIndex: Int, boardIndex: Int, p: Piece) = { cellCount = 0 p.unmark - + find( p.cells(pieceIndex), cells(boardIndex)) - val boardHasSpace = cellCount == Piece.size && - cellsPieceWillFill.forall(c => c.isEmpty) + val boardHasSpace = cellCount == Piece.size && + cellsPieceWillFill.forall(c => c.isEmpty) - if (boardHasSpace) cellsPieceWillFill.foreach(c => c.piece = p) + if (boardHasSpace) cellsPieceWillFill.foreach(c => c.piece = p) boardHasSpace } @@ -180,10 +180,10 @@ final class Board { if (row % 2 == 1) { if (!isLast) c.next(Cell.NE) = a(i-(Board.cols-1)) - c.next(Cell.NW) = a(i-Board.cols) + c.next(Cell.NW) = a(i-Board.cols) if (row != m) { if (!isLast) c.next(Cell.SE) = a(i+(Board.cols+1)) - c.next(Cell.SW) = a(i+Board.cols) + c.next(Cell.SW) = a(i+Board.cols) } } else { if (row != 0) { @@ -212,9 +212,9 @@ final class Board { Console.print(i + "\t") for (j <- Iterator.range(0,Cell.sides)){ val c = cells(i).next(j) - if (c == null) - Console.print("-- ") - else + if (c == null) + Console.print("-- ") + else Console.printf("{0,number,00} ")(c.number) } Console.println("") @@ -241,7 +241,7 @@ final class Piece(_number: Int) { val number = _number val cells = for (i <- Array.range(0,Piece.size)) yield new PieceCell() - { + { number match { case 0 => make0 case 1 => make1 @@ -252,7 +252,7 @@ final class Piece(_number: Int) { case 6 => make6 case 7 => make7 case 8 => make8 - case 9 => make9 + case 9 => make9 } } @@ -395,12 +395,12 @@ final class Piece(_number: Int) { Console.print(i + "\t") for (j <- Iterator.range(0,Cell.sides)){ val c = cells(i).next(j) - if (c == null) - Console.print("-- ") - else + if (c == null) + Console.print("-- ") + else for (k <- Iterator.range(0,Piece.size)){ if (cells(k) == c) Console.printf(" {0,number,0} ")(k) - } + } } Console.println("") } @@ -418,13 +418,13 @@ final class Piece(_number: Int) { object Cell { val NW = 0; val NE = 1 val W = 2; val E = 3 - val SW = 4; val SE = 5 + val SW = 4; val SE = 5 val sides = 6 } abstract class Cell { - implicit def m: Manifest[T] + implicit def t: ClassTag[T] type T val next = new Array[T](Cell.sides) var marked = false @@ -437,7 +437,7 @@ abstract class Cell { final class BoardCell(_number: Int) extends { type T = BoardCell - implicit val m = manifest[BoardCell] + implicit val t = classTag[BoardCell] } with Cell { val number = _number var piece: Piece = _ @@ -448,10 +448,10 @@ final class BoardCell(_number: Int) extends { def contiguousEmptyCells(): Int = { if (!marked && isEmpty){ mark - var count = 1 + var count = 1 for (neighbour <- next) - if (neighbour != null && neighbour.isEmpty) + if (neighbour != null && neighbour.isEmpty) count = count + neighbour.contiguousEmptyCells count } else { 0 } |