aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/disabled/java-interop/pos/t2569/Child.scala9
-rw-r--r--tests/disabled/java-interop/pos/t2569/Parent.java13
-rw-r--r--tests/pending/pos/t2591.scala15
-rw-r--r--tests/pos/t2500.scala6
-rw-r--r--tests/pos/t252.scala17
-rwxr-xr-xtests/pos/t2545.scala10
6 files changed, 70 insertions, 0 deletions
diff --git a/tests/disabled/java-interop/pos/t2569/Child.scala b/tests/disabled/java-interop/pos/t2569/Child.scala
new file mode 100644
index 000000000..64f4dc172
--- /dev/null
+++ b/tests/disabled/java-interop/pos/t2569/Child.scala
@@ -0,0 +1,9 @@
+package varargs
+
+ class Child extends Parent {
+
+ override def concatenate(strings: String*): String =
+ strings map("\"" + _ + "\"") mkString("(", ", ", ")")
+
+ }
+
diff --git a/tests/disabled/java-interop/pos/t2569/Parent.java b/tests/disabled/java-interop/pos/t2569/Parent.java
new file mode 100644
index 000000000..89421becb
--- /dev/null
+++ b/tests/disabled/java-interop/pos/t2569/Parent.java
@@ -0,0 +1,13 @@
+package varargs;
+
+ public class Parent {
+
+ public String concatenate(String... strings) {
+ StringBuilder builder = new StringBuilder();
+ for (String s : strings) {
+ builder.append(s);
+ }
+ return builder.toString();
+ }
+
+ }
diff --git a/tests/pending/pos/t2591.scala b/tests/pending/pos/t2591.scala
new file mode 100644
index 000000000..47ae551bf
--- /dev/null
+++ b/tests/pending/pos/t2591.scala
@@ -0,0 +1,15 @@
+class A
+class B
+
+object Implicits {
+ implicit def imp(x: A): Int = 41
+ implicit def imp(x: B): Int = 41
+}
+
+object Test {
+ // should cause imp to be in scope so that the next expression type checks
+ // `import Implicits._` works
+ import Implicits.imp
+
+ (new A) : Int
+}
diff --git a/tests/pos/t2500.scala b/tests/pos/t2500.scala
new file mode 100644
index 000000000..d0ff99a93
--- /dev/null
+++ b/tests/pos/t2500.scala
@@ -0,0 +1,6 @@
+object Test {
+ import scala.collection._
+ ((Map(1 -> "a", 2 -> "b"): collection.Map[Int, String]) map identity[(Int, String)]) : scala.collection.Map[Int,String]
+ ((SortedMap(1 -> "a", 2 -> "b"): collection.SortedMap[Int, String]) map identity[(Int, String)]): scala.collection.SortedMap[Int,String]
+ ((SortedSet(1, 2): collection.SortedSet[Int]) map identity[Int]): scala.collection.SortedSet[Int]
+}
diff --git a/tests/pos/t252.scala b/tests/pos/t252.scala
new file mode 100644
index 000000000..d51b5511e
--- /dev/null
+++ b/tests/pos/t252.scala
@@ -0,0 +1,17 @@
+abstract class Module {}
+
+abstract class T {
+ type moduleType <: Module
+ val module: moduleType
+}
+
+abstract class Base {
+ type mType = Module
+ type tType = T { type moduleType <: mType }
+}
+
+abstract class Derived extends Base {
+ def f(inputs: List[tType]): Unit = {
+ for (t <- inputs; m = t.module) { }
+ }
+}
diff --git a/tests/pos/t2545.scala b/tests/pos/t2545.scala
new file mode 100755
index 000000000..6ad994223
--- /dev/null
+++ b/tests/pos/t2545.scala
@@ -0,0 +1,10 @@
+trait Frog[T] {
+ def hello: T
+ def size: Int
+ }
+
+ trait OnlyWithFrogs {
+ self: Frog[_] =>
+
+ def sizeStr = size.toString
+ }