Output an Ambiguous error if type is ambiguous. In one case, an identifier was imported from another package but also existed in the package.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/fee5fba2 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fee5fba2 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fee5fba2 Branch: refs/heads/develop Commit: fee5fba23a18892838a5ea59d23b15dc66b238d9 Parents: e2e48e8 Author: Alex Harui <aha...@apache.org> Authored: Mon Sep 16 14:58:27 2013 -0700 Committer: Alex Harui <aha...@apache.org> Committed: Tue Sep 17 12:04:38 2013 -0700 ---------------------------------------------------------------------- .../internal/definitions/ClassDefinitionBase.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fee5fba2/compiler/src/org/apache/flex/compiler/internal/definitions/ClassDefinitionBase.java ---------------------------------------------------------------------- diff --git a/compiler/src/org/apache/flex/compiler/internal/definitions/ClassDefinitionBase.java b/compiler/src/org/apache/flex/compiler/internal/definitions/ClassDefinitionBase.java index 762a181..c09f335 100644 --- a/compiler/src/org/apache/flex/compiler/internal/definitions/ClassDefinitionBase.java +++ b/compiler/src/org/apache/flex/compiler/internal/definitions/ClassDefinitionBase.java @@ -42,10 +42,12 @@ import org.apache.flex.compiler.definitions.metadata.IMetaTag; import org.apache.flex.compiler.definitions.references.IReference; import org.apache.flex.compiler.internal.projects.CompilerProject; import org.apache.flex.compiler.internal.scopes.ASProjectScope; +import org.apache.flex.compiler.internal.scopes.ASScope; import org.apache.flex.compiler.internal.scopes.ASScopeCache; import org.apache.flex.compiler.internal.scopes.TypeScope; import org.apache.flex.compiler.internal.semantics.SemanticUtils; import org.apache.flex.compiler.internal.tree.as.ClassNode; +import org.apache.flex.compiler.problems.AmbiguousReferenceProblem; import org.apache.flex.compiler.problems.DuplicateInterfaceProblem; import org.apache.flex.compiler.problems.ICompilerProblem; import org.apache.flex.compiler.problems.UnknownInterfaceProblem; @@ -173,8 +175,18 @@ public abstract class ClassDefinitionBase extends TypeDefinitionBase implements if (!(typeDefinition instanceof InterfaceDefinition)) { + IDefinition idef = null; + if (typeDefinition == null) + { + idef = implementedInterface.resolve(project, (ASScope)this.getContainingASScope(), DependencyType.INHERITANCE, true); + } if (problems != null) - problems.add(unknownInterfaceProblem(implementedInterface, i)); + { + if (idef instanceof AmbiguousDefinition) + problems.add(new AmbiguousReferenceProblem(getNode(), implementedInterface.getDisplayString())); + else + problems.add(unknownInterfaceProblem(implementedInterface, i)); + } typeDefinition = null; }