summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-09-27 03:33:37 -0700
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-09-27 03:33:37 -0700
commit6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede (patch)
tree8ef2d71c934e4c6a43c12cf23e7cca704c6cde16 /test
parent78879c4dab79c0da8c31a4f7210c46fc0bd892c7 (diff)
parent97ede5a64a60c739f03619f9c0d7e2bf88a97207 (diff)
downloadscala-6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede.tar.gz
scala-6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede.tar.bz2
scala-6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede.zip
Merge pull request #1383 from paulp/issue/5604
Issue/5604
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t5604b/T_1.scala6
-rw-r--r--test/files/pos/t5604b/T_2.scala6
-rw-r--r--test/files/pos/t5604b/Test_1.scala7
-rw-r--r--test/files/pos/t5604b/Test_2.scala7
-rw-r--r--test/files/pos/t5604b/pack_1.scala5
-rw-r--r--test/files/run/t5604.check8
-rw-r--r--test/files/run/t5604.scala50
-rw-r--r--test/pending/pos/overloading-boundaries.scala37
-rw-r--r--test/pending/pos/t4695/T_1.scala4
-rw-r--r--test/pending/pos/t4695/T_2.scala4
-rw-r--r--test/pending/pos/t5877.scala5
-rw-r--r--test/pending/pos/t5954/T_1.scala8
-rw-r--r--test/pending/pos/t5954/T_2.scala8
-rw-r--r--test/pending/pos/t5954/T_3.scala8
-rw-r--r--test/pending/pos/t6225.scala11
15 files changed, 174 insertions, 0 deletions
diff --git a/test/files/pos/t5604b/T_1.scala b/test/files/pos/t5604b/T_1.scala
new file mode 100644
index 0000000000..179dcb10c6
--- /dev/null
+++ b/test/files/pos/t5604b/T_1.scala
@@ -0,0 +1,6 @@
+// sandbox/t5604/T.scala
+package t6504
+
+trait T {
+ def foo: Boolean = false
+}
diff --git a/test/files/pos/t5604b/T_2.scala b/test/files/pos/t5604b/T_2.scala
new file mode 100644
index 0000000000..179dcb10c6
--- /dev/null
+++ b/test/files/pos/t5604b/T_2.scala
@@ -0,0 +1,6 @@
+// sandbox/t5604/T.scala
+package t6504
+
+trait T {
+ def foo: Boolean = false
+}
diff --git a/test/files/pos/t5604b/Test_1.scala b/test/files/pos/t5604b/Test_1.scala
new file mode 100644
index 0000000000..f7c58ebe83
--- /dev/null
+++ b/test/files/pos/t5604b/Test_1.scala
@@ -0,0 +1,7 @@
+// sandbox/t5604/Test.scala
+package t6504
+
+object Test {
+ def blerg1(a: Any): Any = if (foo) blerg1(0)
+ def blerg2(a: Any): Any = if (t6504.foo) blerg2(0)
+}
diff --git a/test/files/pos/t5604b/Test_2.scala b/test/files/pos/t5604b/Test_2.scala
new file mode 100644
index 0000000000..f7c58ebe83
--- /dev/null
+++ b/test/files/pos/t5604b/Test_2.scala
@@ -0,0 +1,7 @@
+// sandbox/t5604/Test.scala
+package t6504
+
+object Test {
+ def blerg1(a: Any): Any = if (foo) blerg1(0)
+ def blerg2(a: Any): Any = if (t6504.foo) blerg2(0)
+}
diff --git a/test/files/pos/t5604b/pack_1.scala b/test/files/pos/t5604b/pack_1.scala
new file mode 100644
index 0000000000..f50d568bfa
--- /dev/null
+++ b/test/files/pos/t5604b/pack_1.scala
@@ -0,0 +1,5 @@
+// sandbox/t5604/pack.scala
+package t6504
+
+object `package` extends T {
+}
diff --git a/test/files/run/t5604.check b/test/files/run/t5604.check
new file mode 100644
index 0000000000..53a2fc8894
--- /dev/null
+++ b/test/files/run/t5604.check
@@ -0,0 +1,8 @@
+long
+double
+long
+double
+long
+double
+long
+double
diff --git a/test/files/run/t5604.scala b/test/files/run/t5604.scala
new file mode 100644
index 0000000000..a06c8aab3e
--- /dev/null
+++ b/test/files/run/t5604.scala
@@ -0,0 +1,50 @@
+// a.scala
+// Fri Jan 13 11:31:47 PST 2012
+
+package foo {
+ object regular extends Duh {
+ def buh(n: Long) = println("long")
+ def buh(n: Double) = println("double")
+ }
+ class regular {
+ import regular._
+
+ duh(33L)
+ duh(3.0d)
+ foo.regular.duh(33L)
+ foo.regular.duh(3.0d)
+ buh(66L)
+ buh(6.0d)
+ foo.regular.buh(66L)
+ foo.regular.buh(6.0d)
+ }
+
+ trait Duh {
+ def duh(n: Long) = println("long")
+ def duh(n: Double) = println("double")
+ }
+ package object bar extends Duh {
+ def buh(n: Long) = println("long")
+ def buh(n: Double) = println("double")
+ }
+ package bar {
+ object Main {
+ def main(args:Array[String]) {
+ duh(33L)
+ duh(3.0d)
+ foo.bar.duh(33L)
+ foo.bar.duh(3.0d)
+ buh(66L)
+ buh(6.0d)
+ foo.bar.buh(66L)
+ foo.bar.buh(6.0d)
+ }
+ }
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ foo.bar.Main.main(null)
+ }
+}
diff --git a/test/pending/pos/overloading-boundaries.scala b/test/pending/pos/overloading-boundaries.scala
new file mode 100644
index 0000000000..d2e9fdbb12
--- /dev/null
+++ b/test/pending/pos/overloading-boundaries.scala
@@ -0,0 +1,37 @@
+package bar {
+ object bippy extends (Double => String) {
+ def apply(x: Double): String = "Double"
+ }
+}
+
+package object bar {
+ def bippy(x: Int, y: Int, z: Int) = "(Int, Int, Int)"
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ println(bar.bippy(5.5d))
+ println(bar.bippy(1, 2, 3))
+ }
+}
+
+/****
+
+% scalac3 a.scala
+a.scala:13: error: not enough arguments for method bippy: (x: Int, y: Int, z: Int)String.
+Unspecified value parameters y, z.
+ println(bar.bippy(5.5d))
+ ^
+one error found
+
+# Comment out the call to bar.bippy(5.5d) - compiles
+% scalac3 a.scala
+
+# Compiles only from pure source though - if classes are present, fails.
+% scalac3 a.scala
+a.scala:2: error: bippy is already defined as method bippy in package object bar
+ object bippy extends (Double => String) {
+ ^
+one error found
+
+****/
diff --git a/test/pending/pos/t4695/T_1.scala b/test/pending/pos/t4695/T_1.scala
new file mode 100644
index 0000000000..70fb1a7f21
--- /dev/null
+++ b/test/pending/pos/t4695/T_1.scala
@@ -0,0 +1,4 @@
+package foo
+
+class Bar { }
+package object Bar { }
diff --git a/test/pending/pos/t4695/T_2.scala b/test/pending/pos/t4695/T_2.scala
new file mode 100644
index 0000000000..70fb1a7f21
--- /dev/null
+++ b/test/pending/pos/t4695/T_2.scala
@@ -0,0 +1,4 @@
+package foo
+
+class Bar { }
+package object Bar { }
diff --git a/test/pending/pos/t5877.scala b/test/pending/pos/t5877.scala
new file mode 100644
index 0000000000..b77605f7f2
--- /dev/null
+++ b/test/pending/pos/t5877.scala
@@ -0,0 +1,5 @@
+package foo { }
+
+package object foo {
+ implicit class Foo(val s: String) { }
+}
diff --git a/test/pending/pos/t5954/T_1.scala b/test/pending/pos/t5954/T_1.scala
new file mode 100644
index 0000000000..0064c596b6
--- /dev/null
+++ b/test/pending/pos/t5954/T_1.scala
@@ -0,0 +1,8 @@
+package p {
+ package base {
+ class X
+ }
+ package object base {
+ case class B()
+ }
+}
diff --git a/test/pending/pos/t5954/T_2.scala b/test/pending/pos/t5954/T_2.scala
new file mode 100644
index 0000000000..0064c596b6
--- /dev/null
+++ b/test/pending/pos/t5954/T_2.scala
@@ -0,0 +1,8 @@
+package p {
+ package base {
+ class X
+ }
+ package object base {
+ case class B()
+ }
+}
diff --git a/test/pending/pos/t5954/T_3.scala b/test/pending/pos/t5954/T_3.scala
new file mode 100644
index 0000000000..0064c596b6
--- /dev/null
+++ b/test/pending/pos/t5954/T_3.scala
@@ -0,0 +1,8 @@
+package p {
+ package base {
+ class X
+ }
+ package object base {
+ case class B()
+ }
+}
diff --git a/test/pending/pos/t6225.scala b/test/pending/pos/t6225.scala
new file mode 100644
index 0000000000..d7dff3c419
--- /dev/null
+++ b/test/pending/pos/t6225.scala
@@ -0,0 +1,11 @@
+package library.x {
+ class X {
+ class Foo
+ implicit val foo = new Foo
+ }
+}
+package library { package object x extends X }
+package app {
+ import library.x._
+ object App { implicitly[Foo] }
+}