From 8383b65fb53ae9424cf9c6f1314ee73321ad3b9a Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 11 Mar 2013 22:12:11 +0100 Subject: SI-7232 Fix Java import vs defn. binding precendence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- test/files/pos/t7232b/Foo.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/files/pos/t7232b/Foo.java (limited to 'test/files/pos/t7232b/Foo.java') diff --git a/test/files/pos/t7232b/Foo.java b/test/files/pos/t7232b/Foo.java new file mode 100644 index 0000000000..94f08d545e --- /dev/null +++ b/test/files/pos/t7232b/Foo.java @@ -0,0 +1,8 @@ +package pack; + +import java.util.*; + +public class Foo { + // should be pack.List. + public static List list() { throw new Error(); } +} -- cgit v1.2.3