Index: Scope.java =================================================================== RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.74 diff -u -r1.74 Scope.java --- Scope.java 18 Jul 2003 16:57:52 -0000 1.74 +++ Scope.java 25 Sep 2003 09:03:34 -0000 @@ -1318,6 +1318,7 @@ // at this point the scope is a compilation unit scope CompilationUnitScope unitScope = (CompilationUnitScope) scope; PackageBinding currentPackage = unitScope.fPackage; + ReferenceBinding problem = null; // ask for the imports + name if ((mask & TYPE) != 0) { // check single type imports. @@ -1364,14 +1365,18 @@ ReferenceBinding temp = resolvedImport instanceof PackageBinding ? findType(name, (PackageBinding) resolvedImport, currentPackage) : findDirectMemberType(name, (ReferenceBinding) resolvedImport); - if (temp != null && temp.isValidBinding()) { - ImportReference importReference = someImport.reference; - if (importReference != null) importReference.used = true; - if (foundInImport) - // Answer error binding -- import on demand conflict; name found in two import on demand packages. - return new ProblemReferenceBinding(name, Ambiguous); - type = temp; - foundInImport = true; + if (temp != null) { + if (temp.isValidBinding()) { + ImportReference importReference = someImport.reference; + if (importReference != null) importReference.used = true; + if (foundInImport) + // Answer error binding -- import on demand conflict; name found in two import on demand packages. + return new ProblemReferenceBinding(name, Ambiguous); + type = temp; + foundInImport = true; + } else { + problem = temp; + } } } } @@ -1387,7 +1392,11 @@ // Answer error binding -- could not find name if (foundType != null) return foundType; // problem type from above - return new ProblemReferenceBinding(name, NotFound); + if (problem == null) { + return new ProblemReferenceBinding(name, NotFound); + } else { + return problem; + } } /* Answer whether the type is defined in the same compilation unit as the receiver