summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-06-09 13:27:31 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-06-09 14:14:45 +0200
commit666bbe730aa647a8476a33ca79beba671b80b3d2 (patch)
tree55f23b22325297b40d6794303313f28dc5c3b161 /test
parent43ae8259f2e01393219d1ece0c87614eece32621 (diff)
downloadscala-666bbe730aa647a8476a33ca79beba671b80b3d2.tar.gz
scala-666bbe730aa647a8476a33ca79beba671b80b3d2.tar.bz2
scala-666bbe730aa647a8476a33ca79beba671b80b3d2.zip
SI-4831 Fix ambiguous import detection for renamed imports.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t4831.check7
-rw-r--r--test/files/neg/t4831.scala11
-rw-r--r--test/files/pos/t4831.scala11
3 files changed, 29 insertions, 0 deletions
diff --git a/test/files/neg/t4831.check b/test/files/neg/t4831.check
new file mode 100644
index 0000000000..3b8b836f05
--- /dev/null
+++ b/test/files/neg/t4831.check
@@ -0,0 +1,7 @@
+t4831.scala:10: error: reference to b is ambiguous;
+it is imported twice in the same scope by
+import O.b
+and import O.{a=>b}
+ println(b)
+ ^
+one error found
diff --git a/test/files/neg/t4831.scala b/test/files/neg/t4831.scala
new file mode 100644
index 0000000000..82346ec57d
--- /dev/null
+++ b/test/files/neg/t4831.scala
@@ -0,0 +1,11 @@
+object O {
+ val a = 0
+ val b = 1
+}
+
+import O.{a => b}
+import O.b
+
+object test {
+ println(b)
+}
diff --git a/test/files/pos/t4831.scala b/test/files/pos/t4831.scala
new file mode 100644
index 0000000000..48002106e6
--- /dev/null
+++ b/test/files/pos/t4831.scala
@@ -0,0 +1,11 @@
+object O {
+ val a = 0
+}
+
+
+object test {
+ val O1: O.type = O
+ val O2: O.type = O
+ import O1.a, O2.a
+ println(a)
+}