diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t6648.scala | 24 | ||||
-rw-r--r-- | test/files/run/t6644.scala | 8 | ||||
-rw-r--r-- | test/files/run/t6646.check | 5 | ||||
-rw-r--r-- | test/files/run/t6646.scala | 19 |
4 files changed, 56 insertions, 0 deletions
diff --git a/test/files/pos/t6648.scala b/test/files/pos/t6648.scala new file mode 100644 index 0000000000..9593ebfee9 --- /dev/null +++ b/test/files/pos/t6648.scala @@ -0,0 +1,24 @@ +abstract class Node extends NodeSeq +trait NodeSeq extends Seq[Node] +object NodeSeq { + implicit def seqToNodeSeq(ns: Seq[Node]): NodeSeq = ??? + def foo[B, That](f: Seq[B])(implicit bf: scala.collection.generic.CanBuildFrom[Seq[Int], B, That]): That = ??? +} + +class Transformer { + def apply(nodes: Any): Any = ??? +} + +object transformer1 extends Transformer { + // Adding explicit type arguments, or making the impilcit view + // seqToNodeSeq explicit avoids the crash + NodeSeq.foo { + // These both avoid the crash: + // val t = new Transformer {}; t.apply(null) + // new Transformer().apply(null) + new Transformer {}.apply(null) + + null: NodeSeq + }: NodeSeq +} + diff --git a/test/files/run/t6644.scala b/test/files/run/t6644.scala new file mode 100644 index 0000000000..b8b36f957c --- /dev/null +++ b/test/files/run/t6644.scala @@ -0,0 +1,8 @@ +class Testable(val c: String) extends AnyVal { + def matching(cases: Boolean*) = cases contains true +} + +object Test extends App { + assert(new Testable("").matching(true, false)) +} + diff --git a/test/files/run/t6646.check b/test/files/run/t6646.check new file mode 100644 index 0000000000..b0b7ad32f3 --- /dev/null +++ b/test/files/run/t6646.check @@ -0,0 +1,5 @@ +Found NotNull +Found lower +Found 2 +A single ident is always a pattern +A single ident is always a pattern diff --git a/test/files/run/t6646.scala b/test/files/run/t6646.scala new file mode 100644 index 0000000000..150b0df11e --- /dev/null +++ b/test/files/run/t6646.scala @@ -0,0 +1,19 @@ +sealed trait ColumnOption +case object NotNull extends ColumnOption +case object PrimaryKey extends ColumnOption +case object lower extends ColumnOption + +object Test { + def main(args: Array[String]) { + val l = List(PrimaryKey, NotNull, lower) + + // withFilter must be generated in these + for (option @ NotNull <- l) println("Found " + option) + for (option @ `lower` <- l) println("Found " + option) + for ((`lower`, i) <- l.zipWithIndex) println("Found " + i) + + // no withFilter + for (X <- List("A single ident is always a pattern")) println(X) + for (`x` <- List("A single ident is always a pattern")) println(`x`) + } +} |