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;
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;
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(
return parent.enclosingSourceType();
}
+ public ReferenceBinding effectiveThisType() {
+ return onType;
+ }
+
public int addDepth() {
return 0;
}