For this source code ...
... Eclipse reports the following error:
Only a type can be imported. pkg.a resolves to a package
... while Suns javac
compiles it fine.
Similar situation if I try to fully qualify the class pkg.a
like this:
Eclipse reports...
pkg.a cannot be resolved to a type
... while Suns javac
compiles it fine.
It seems like Eclipse favors interpreting an identifier as a package over a class name, while javac does the exact opposite. So, is it a bug in Eclipse or in javac?
(A reference to the language specification is obviously a plus.)