aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/i884.scala4
-rw-r--r--tests/pos/i903.scala26
-rw-r--r--tests/pos/java-interop/i879.java11
-rw-r--r--tests/pos/overloadedAccess.scala1
-rw-r--r--tests/pos/typedIdents/PQ.scala6
-rw-r--r--tests/pos/typedIdents/typedIdents.scala (renamed from tests/pos/typedIdents.scala)6
6 files changed, 47 insertions, 7 deletions
diff --git a/tests/pos/i884.scala b/tests/pos/i884.scala
new file mode 100644
index 000000000..29e53b9be
--- /dev/null
+++ b/tests/pos/i884.scala
@@ -0,0 +1,4 @@
+import scala.reflect._
+
+object `package` {
+}
diff --git a/tests/pos/i903.scala b/tests/pos/i903.scala
new file mode 100644
index 000000000..5afb6e530
--- /dev/null
+++ b/tests/pos/i903.scala
@@ -0,0 +1,26 @@
+object Test {
+ def contains(s: String, i: Int) = true
+ def test1 = {
+ val f = contains("", (_: Int))
+ val ff = contains("", ((_: Int)))
+ val g: Int => Boolean = contains("", (_))
+ val gg: Int => Boolean = contains("", ((_)))
+ f.apply(0)
+ // sandbox/eta.scala:4: error: type mismatch:
+ // found : Int => Int
+ // required: Int
+ // val f = contains("", (_: Int))
+ // ^
+ // sandbox/eta.scala:5: error: apply is not a member of Boolean(f)
+ // f.apply(0)
+ // ^
+ }
+
+ def test2 = {
+ val f = "".contains("", (_: Int)) // dotc:
+ f.apply(0)
+ // sandbox/eta.scala:18: error: apply is not a member of Boolean(f)
+ // f.apply(0)
+ // ^
+ }
+}
diff --git a/tests/pos/java-interop/i879.java b/tests/pos/java-interop/i879.java
new file mode 100644
index 000000000..6db5b77ff
--- /dev/null
+++ b/tests/pos/java-interop/i879.java
@@ -0,0 +1,11 @@
+class Foo {
+ Foo(int i) {
+ }
+}
+
+
+class Bar extends Foo {
+ Bar() {
+ super(10);
+ }
+} \ No newline at end of file
diff --git a/tests/pos/overloadedAccess.scala b/tests/pos/overloadedAccess.scala
index a2d72f583..10168b61d 100644
--- a/tests/pos/overloadedAccess.scala
+++ b/tests/pos/overloadedAccess.scala
@@ -14,5 +14,4 @@ object overloadedAccess {
val x = f("abc")
val y: Int = x
}
-
}
diff --git a/tests/pos/typedIdents/PQ.scala b/tests/pos/typedIdents/PQ.scala
new file mode 100644
index 000000000..8a5afede0
--- /dev/null
+++ b/tests/pos/typedIdents/PQ.scala
@@ -0,0 +1,6 @@
+package P {
+ object X { val x = 1; val y = 2 }
+}
+package Q {
+ object X { val x = true; val y = "" }
+}
diff --git a/tests/pos/typedIdents.scala b/tests/pos/typedIdents/typedIdents.scala
index e99b5a045..95b9f1b63 100644
--- a/tests/pos/typedIdents.scala
+++ b/tests/pos/typedIdents/typedIdents.scala
@@ -1,9 +1,3 @@
-package P {
- object X { val x = 1; val y = 2 }
-}
-package Q {
- object X { val x = true; val y = "" }
-}
package P { // `X' bound by package clause
import Console._ // `println' bound by wildcard import
object A {