summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/pos/t4651.scala12
-rw-r--r--test/files/run/t3702.check2
-rw-r--r--test/files/run/t3702.scala11
-rw-r--r--test/files/run/t4482.check1
-rw-r--r--test/files/run/t4482.scala15
-rw-r--r--test/pending/pos/t1832.scala10
-rw-r--r--test/pending/pos/t3439.scala2
-rw-r--r--test/pending/pos/t5091.scala11
-rw-r--r--test/pending/pos/t5231.scala18
-rw-r--r--test/pending/pos/t5265.scala21
10 files changed, 103 insertions, 0 deletions
diff --git a/test/files/pos/t4651.scala b/test/files/pos/t4651.scala
new file mode 100644
index 0000000000..0612a8fcfb
--- /dev/null
+++ b/test/files/pos/t4651.scala
@@ -0,0 +1,12 @@
+object Test {
+ def analyze(x: Any) = x match {
+ case s: String => println("It's a string: " + s)
+ case 1 => println("It's a one")
+ case (a: Int, b) => println("It's a pair of and int " + a +
+ " and something " + b)
+ case 1 :: 2 :: _ => println("It's a list starting with 1, 2")
+ case List(a, b, c) => println("It's a three-element list with " +
+ a + ", " + b + ", " + c)
+ case _ => println("It's something different")
+ }
+}
diff --git a/test/files/run/t3702.check b/test/files/run/t3702.check
new file mode 100644
index 0000000000..31c2ac4ed1
--- /dev/null
+++ b/test/files/run/t3702.check
@@ -0,0 +1,2 @@
+()
+6
diff --git a/test/files/run/t3702.scala b/test/files/run/t3702.scala
new file mode 100644
index 0000000000..021abcb625
--- /dev/null
+++ b/test/files/run/t3702.scala
@@ -0,0 +1,11 @@
+object Test {
+ def foo(h: Any, t: List[Any]) = h match {
+ case 5 :: _ => ()
+ case List(from) => from
+ }
+
+ def main(args: Array[String]): Unit = {
+ println(foo(5 :: Nil, List(1,2,3)))
+ println(foo(6 :: Nil, List(1,2,3)))
+ }
+}
diff --git a/test/files/run/t4482.check b/test/files/run/t4482.check
new file mode 100644
index 0000000000..0cfbf08886
--- /dev/null
+++ b/test/files/run/t4482.check
@@ -0,0 +1 @@
+2
diff --git a/test/files/run/t4482.scala b/test/files/run/t4482.scala
new file mode 100644
index 0000000000..392861c22e
--- /dev/null
+++ b/test/files/run/t4482.scala
@@ -0,0 +1,15 @@
+trait Foo { def i: Int }
+trait Bar
+
+case class Spam(i: Int) extends Foo with Bar
+
+object Test {
+ def matchParent(p:Any) = p match {
+ case f:Foo if f.i == 1 => 1
+ case _:Bar => 2
+ case _:Foo => 3
+ }
+ def main(args: Array[String]): Unit = {
+ println(matchParent(Spam(3)))
+ }
+}
diff --git a/test/pending/pos/t1832.scala b/test/pending/pos/t1832.scala
new file mode 100644
index 0000000000..bca863f4bd
--- /dev/null
+++ b/test/pending/pos/t1832.scala
@@ -0,0 +1,10 @@
+// Edit by paulp: reduced.
+trait Cloning {
+ trait Foo
+ def fn(g: Int => Unit): Foo
+
+ implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null }
+
+ val pool1 = 4 * fn { case i => i * 2 }
+ val pool2 = 4 * fn { case i: Int => i * 2 }
+}
diff --git a/test/pending/pos/t3439.scala b/test/pending/pos/t3439.scala
new file mode 100644
index 0000000000..425f1aeeb5
--- /dev/null
+++ b/test/pending/pos/t3439.scala
@@ -0,0 +1,2 @@
+abstract class ParametricMessage[M: Manifest](msg: M) { def message = msg }
+case class ParametricMessage1[M: Manifest](msg: M, p1: Class[_]) extends ParametricMessage(msg)
diff --git a/test/pending/pos/t5091.scala b/test/pending/pos/t5091.scala
new file mode 100644
index 0000000000..217e83f66d
--- /dev/null
+++ b/test/pending/pos/t5091.scala
@@ -0,0 +1,11 @@
+object RecursiveValueNeedsType {
+
+ def foo(param: String) = 42
+ def bar(n: Int) = 42
+
+ {
+ val xxx = foo(param = null)
+ val param = bar(xxx)
+ }
+
+}
diff --git a/test/pending/pos/t5231.scala b/test/pending/pos/t5231.scala
new file mode 100644
index 0000000000..77e6631ebb
--- /dev/null
+++ b/test/pending/pos/t5231.scala
@@ -0,0 +1,18 @@
+object Client {
+ sealed trait ConfigLike {
+ def clientID: Int
+ }
+
+ object Config {
+ def apply() : ConfigBuilder = new ConfigBuilder()
+ implicit def build( cb: ConfigBuilder ) : Config = cb.build
+ }
+
+ final class Config private[Client]( val clientID: Int )
+ extends ConfigLike
+
+ final class ConfigBuilder private () extends ConfigLike {
+ var clientID: Int = 0
+ def build : Config = new Config( clientID )
+ }
+}
diff --git a/test/pending/pos/t5265.scala b/test/pending/pos/t5265.scala
new file mode 100644
index 0000000000..3be7d2187e
--- /dev/null
+++ b/test/pending/pos/t5265.scala
@@ -0,0 +1,21 @@
+import java.util.Date
+
+trait TDate
+
+trait TT[A1,T1]
+
+trait TTFactory[F,G] {
+ def create(f: F) : TT[F,G]
+ def sample: F
+}
+
+object Impls {
+
+ // If the c1 is declared before c2, it compiles fine
+ implicit def c2(s: Date) = c1.create(s)
+
+ implicit val c1 = new TTFactory[Date,TDate] {
+ def create(v: Date): TT[Date,TDate] = sys.error("")
+ def sample = new Date
+ }
+} \ No newline at end of file