diff options
author | James Iry <jamesiry@gmail.com> | 2013-11-18 07:59:56 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-11-18 07:59:56 -0800 |
commit | 8d094c930fc570dcc7f4978777f9af03d5e47e5a (patch) | |
tree | e227987c7552b4fd2c25caed23d5bee843e00d6c /test/files/pos | |
parent | 490b82b78e040259ffeb6ef2fe9690f92117922f (diff) | |
parent | 5b532e927241bfaea4aa9b36e32ff3a0deb1ae15 (diff) | |
download | scala-8d094c930fc570dcc7f4978777f9af03d5e47e5a.tar.gz scala-8d094c930fc570dcc7f4978777f9af03d5e47e5a.tar.bz2 scala-8d094c930fc570dcc7f4978777f9af03d5e47e5a.zip |
Merge pull request #3135 from adriaanm/revive-xml-tests
Revived tests that once depended on xml
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t1014.scala | 16 | ||||
-rw-r--r-- | test/files/pos/t1203a.scala | 13 | ||||
-rw-r--r-- | test/files/pos/t2698.scala | 14 | ||||
-rw-r--r-- | test/files/pos/t3160.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t6201.scala | 19 |
5 files changed, 68 insertions, 0 deletions
diff --git a/test/files/pos/t1014.scala b/test/files/pos/t1014.scala new file mode 100644 index 0000000000..6fb7f7ba49 --- /dev/null +++ b/test/files/pos/t1014.scala @@ -0,0 +1,16 @@ +class NodeSeq +class Elem extends NodeSeq + +class EO extends App with Moo { + // return type is Flog, inherited from overridden method. + // implicit conversions are applied because expected type `pt` is `Flog` when `computeType(rhs, pt)`. + def cat = (??? : Elem) + + implicit def nodeSeqToFlog(in: Elem): Flog = new Flog(in) +} + +trait Moo { + def cat: Flog +} + +class Flog(val in: NodeSeq) diff --git a/test/files/pos/t1203a.scala b/test/files/pos/t1203a.scala new file mode 100644 index 0000000000..cf5ab9fba0 --- /dev/null +++ b/test/files/pos/t1203a.scala @@ -0,0 +1,13 @@ +class Node +object NodeSeq { + implicit def seqToNodeSeq(s: Seq[Node]): NodeSeq = ??? +} +abstract class NodeSeq extends collection.immutable.Seq[Node] + +case class ant(t: String) extends scala.annotation.Annotation +object Test { + def main(args: Array[String]): Unit = { + val a: NodeSeq @ant("12") = Nil + println(a) + } +} diff --git a/test/files/pos/t2698.scala b/test/files/pos/t2698.scala new file mode 100644 index 0000000000..bce02e48b3 --- /dev/null +++ b/test/files/pos/t2698.scala @@ -0,0 +1,14 @@ +class WordExp { + abstract class Label + type _labelT <: Label +} + +import scala.collection._ + +abstract class S2 { + val lang: WordExp + type __labelT = lang._labelT + + var deltaq: Array[__labelT] = _ + def delta1 = immutable.Map(deltaq.zipWithIndex: _*) +} diff --git a/test/files/pos/t3160.scala b/test/files/pos/t3160.scala new file mode 100644 index 0000000000..cc007dc014 --- /dev/null +++ b/test/files/pos/t3160.scala @@ -0,0 +1,6 @@ +import scala.collection.mutable._ +class Node + +class A { + def f(x: Node): Node = ??? +} diff --git a/test/files/pos/t6201.scala b/test/files/pos/t6201.scala new file mode 100644 index 0000000000..d4e5bce03a --- /dev/null +++ b/test/files/pos/t6201.scala @@ -0,0 +1,19 @@ +// probably needs xml's weirdness to reproduce +// (specifically, _root_.scala.xml.Null being in the root package) +class Elem + +class Test { + def elem: Elem = ??? + + class Foo1 { + def must(x: Elem) = () + } + + class Foo2 { + def must(x: Int) = () + } + implicit def toFoo1(s: Elem) = new Foo1() + implicit def toFoo2(s: Elem) = new Foo2() + + def is: Unit = { (elem) } +}
\ No newline at end of file |