aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-29 18:51:33 +0100
committerMartin Odersky <odersky@gmail.com>2015-10-29 19:12:18 +0100
commit32f31b8924d16074679bfa0857019d3ba078c4a2 (patch)
tree40511677d6fe36cc505bfa46e1a09e8732097cfd /tests
parent51ab200f97f11ac74270f6925028ba4d58284e7b (diff)
downloaddotty-32f31b8924d16074679bfa0857019d3ba078c4a2.tar.gz
dotty-32f31b8924d16074679bfa0857019d3ba078c4a2.tar.bz2
dotty-32f31b8924d16074679bfa0857019d3ba078c4a2.zip
Fix #884 - misdiagnosed ambiguous definition.
Universal equality strikes again. Caused a bug in isDefinedInCurrentUnit.
Diffstat (limited to 'tests')
-rw-r--r--tests/neg/typedIdents/PQ.scala6
-rw-r--r--tests/neg/typedIdents/typedIdents.scala (renamed from tests/neg/typedIdents.scala)6
-rw-r--r--tests/pos/i884.scala4
-rw-r--r--tests/pos/overloadedAccess.scala1
-rw-r--r--tests/pos/typedIdents.scala34
-rw-r--r--tests/pos/typedIdents/PQ.scala6
6 files changed, 16 insertions, 41 deletions
diff --git a/tests/neg/typedIdents/PQ.scala b/tests/neg/typedIdents/PQ.scala
new file mode 100644
index 000000000..8a5afede0
--- /dev/null
+++ b/tests/neg/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/neg/typedIdents.scala b/tests/neg/typedIdents/typedIdents.scala
index cb7cca743..4937edfe3 100644
--- a/tests/neg/typedIdents.scala
+++ b/tests/neg/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 {
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/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.scala b/tests/pos/typedIdents.scala
deleted file mode 100644
index e99b5a045..000000000
--- a/tests/pos/typedIdents.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-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 {
- println("L4: " + X) // `X' refers to `P.X' here
- object B {
- import Q._ // `X' bound by wildcard import
- println("L7: " + X) // `X' refers to `Q.X' here
- import X._ // `x' and `y' bound by wildcard import
- println("L8: " + x) // `x' refers to `Q.X.x' here
- object C {
- val x = 3 // `x' bound by local definition
- println("L12: " + x) // `x' refers to constant `3' here
- locally {
- import Q.X._ // `x' and `y' bound by wildcard import
- // println("L14: " + x) // reference to `x' is ambiguous here
- import X.y // `y' bound by explicit import
- println("L16: " + y) // `y' refers to `Q.X.y' here
- locally {
- val x = "abc" // `x' bound by local definition
- import P.X._ // `x' and `y' bound by wildcard import
- // println("L19: " + y) // reference to `y' is ambiguous here
- println("L20: " + x) // `x' refers to string ``abc'' here
- }
- }
- }
- }
- }
-}
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 = "" }
+}