summaryrefslogtreecommitdiff
path: root/test/files/pos/t7232d
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-03-11 22:12:11 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-03-26 08:48:47 +0100
commit8383b65fb53ae9424cf9c6f1314ee73321ad3b9a (patch)
treedc9c1a18064a0f8f990f87ca22c8a7d24e5b286c /test/files/pos/t7232d
parent59d4998cf4a19eb5d44118d4867c2370e9a935e5 (diff)
downloadscala-8383b65fb53ae9424cf9c6f1314ee73321ad3b9a.tar.gz
scala-8383b65fb53ae9424cf9c6f1314ee73321ad3b9a.tar.bz2
scala-8383b65fb53ae9424cf9c6f1314ee73321ad3b9a.zip
SI-7232 Fix Java import vs defn. binding precendence
Java Spec: > A single-type-import declaration d in a compilation unit c > of package p that imports a type named n shadows, throughout > c, the declarations of: > - any top level type named n declared in another compilation > unit of p > - any type named n imported by a type-import-on-demand > declaration in c > - any type named n imported by a static-import-on-demand > declaration in c Scala Spec: > Bindings of different kinds have a precedence defined on them: > 1. Definitions and declarations that are local, inherited, or made > available by a package clause in the same compilation unit where > the definition occurs have highest precedence. > 2. Explicit imports have next highest precedence. This is a forward port of 6e79370, which did not merge cleanly and was omitted in the regular merge from 2.10.x to master. Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
Diffstat (limited to 'test/files/pos/t7232d')
-rw-r--r--test/files/pos/t7232d/Entry.java4
-rw-r--r--test/files/pos/t7232d/Foo.java8
-rw-r--r--test/files/pos/t7232d/Test.scala4
3 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t7232d/Entry.java b/test/files/pos/t7232d/Entry.java
new file mode 100644
index 0000000000..0cfb6fb25b
--- /dev/null
+++ b/test/files/pos/t7232d/Entry.java
@@ -0,0 +1,4 @@
+package pack;
+
+public class Entry {
+}
diff --git a/test/files/pos/t7232d/Foo.java b/test/files/pos/t7232d/Foo.java
new file mode 100644
index 0000000000..df7114a0f0
--- /dev/null
+++ b/test/files/pos/t7232d/Foo.java
@@ -0,0 +1,8 @@
+package pack;
+
+import java.util.Map.Entry;
+
+public class Foo {
+ public static Entry mapEntry() { throw new Error(); }
+ public static void javaTest() { mapEntry().getKey(); }
+}
diff --git a/test/files/pos/t7232d/Test.scala b/test/files/pos/t7232d/Test.scala
new file mode 100644
index 0000000000..89a8063b3c
--- /dev/null
+++ b/test/files/pos/t7232d/Test.scala
@@ -0,0 +1,4 @@
+object Test {
+ import pack._
+ Foo.mapEntry().getKey()
+}