Community
Participate
Working Groups
Let's say we have following test case: File X.java: class X { void foo () { Y y; } } File p/Y.java: package p; class Y { } When I compile this I got following error: ---------- 1. ERROR in d:\usr\oti\workspaces\dvpt-ffr\Crap\src\X.java (at line 5) Y y; ^ Y cannot be resolved or is not a type ---------- 1 problem (1 error) I think compiler should complain that Y is not visible instead of saying it cannot be resolved...
Created attachment 6228 [details] Proposed fix The fix here is applied in Scope.getTypeOrPackage(char[],int): store the problem reference binding when it's detected in loop and return it if no type was finally found at the end of the method...
Is this the complete testcase? The class X is in the default package & doesn't import p.* or p.Y? Then how is it ever supposed to find it?
import p.*; public class X { void foo () { Y y; } }
import p.Y; public class X { void foo () { Y y; } }
Fixed.
Verified.