]> source.dussan.org Git - aspectj.git/commitdiff
making inter-type decls work with incremental mode
authorjhugunin <jhugunin>
Fri, 3 Jan 2003 19:17:41 +0000 (19:17 +0000)
committerjhugunin <jhugunin>
Fri, 3 Jan 2003 19:17:41 +0000 (19:17 +0000)
 (partially there)

org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseObjectType.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java

index a52d3cad1912b2b3ab5de670b24b6f00bf03d720..cf97401803fa17d5c416a8e9b732818b30ae456d 100644 (file)
@@ -561,7 +561,7 @@ public class AspectDeclaration extends MemberTypeDeclaration {
        
        
        private PerClause.Kind lookupPerClauseKind(ReferenceBinding binding) {
-               if (binding instanceof SourceTypeBinding) {
+               if (binding instanceof SourceTypeBinding && !(binding instanceof BinaryTypeBinding)) {
                        SourceTypeBinding sourceSc = (SourceTypeBinding)binding;
                        if (sourceSc.scope.referenceContext instanceof AspectDeclaration) {
                                PerClause perClause = ((AspectDeclaration)sourceSc.scope.referenceContext).perClause;
index 6939d8580b852875b5bcbfa625d31cdb9bc8eec7..4167cecaa1f501c159f4f1f93f491ab6b69d84f0 100644 (file)
@@ -43,6 +43,7 @@ public class EclipseObjectType extends ResolvedTypeX.Name {
 
 
        public boolean isAspect() {
+               if (binding instanceof BinaryTypeBinding) return false;
                if (!(binding instanceof SourceTypeBinding)) return false;
                //XXX assume SourceBinding throughout
                return ((SourceTypeBinding)binding).scope.referenceContext instanceof AspectDeclaration;
index 05bddbd5882bf69186f61db5b52202129066102a..2a70e641e866099a47d96c1e92346a15b30698ea 100644 (file)
@@ -17,16 +17,19 @@ import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
 import org.eclipse.jdt.internal.compiler.lookup.*;
 
 public class InterTypeScope extends ClassScope {
+       ReferenceBinding onType;
 
-       public InterTypeScope(Scope parent, TypeBinding onType) {
+       public InterTypeScope(Scope parent, ReferenceBinding onType) {
                super(parent, null);
-               if (onType instanceof SourceTypeBinding) {
-                       referenceContext = new TypeDeclaration(null);
-                       referenceContext.binding = ((SourceTypeBinding)onType);
-               } else {
-                       throw new RuntimeException("unimplemented");
-               }
-               //System.out.println("encolsingSource: " + this.enclosingSourceType());
+               referenceContext = new TypeDeclaration(null);
+               referenceContext.binding = makeSourceTypeBinding(onType);
+               this.onType = onType;
+       }
+
+       private SourceTypeBinding makeSourceTypeBinding(ReferenceBinding onType) {
+               if (onType instanceof SourceTypeBinding) return (SourceTypeBinding)onType;
+               else throw new RuntimeException("can't handle: " + onType);
+               //return new FakeSourceTypeBinding(onType);
        }
 
        public FieldBinding findField(
@@ -42,6 +45,10 @@ public class InterTypeScope extends ClassScope {
                return parent.enclosingSourceType();
        }
        
+       public ReferenceBinding effectiveThisType() {
+               return onType;
+       }
+       
        public int addDepth() {
                return 0;
        }