Skip to content

Commit

Permalink
Metamodel: ignore annotation proxy classes #347
Browse files Browse the repository at this point in the history
  • Loading branch information
FroMage committed Apr 10, 2014
1 parent d4ce16e commit 8401d6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -61,6 +61,7 @@
import com.redhat.ceylon.compiler.loader.ModelLoader.DeclarationType;
import com.redhat.ceylon.compiler.loader.impl.reflect.mirror.ReflectionClass;
import com.redhat.ceylon.compiler.loader.impl.reflect.mirror.ReflectionMethod;
import com.redhat.ceylon.compiler.loader.model.AnnotationProxyClass;
import com.redhat.ceylon.compiler.loader.model.FunctionOrValueInterface;
import com.redhat.ceylon.compiler.loader.model.JavaMethod;
import com.redhat.ceylon.compiler.loader.model.LazyClass;
Expand Down Expand Up @@ -448,10 +449,13 @@ public static java.lang.Class<?> getJavaClass(com.redhat.ceylon.compiler.typeche
ReflectionClass classMirror = (ReflectionClass) ((LazyTypeAlias) declaration).classMirror;
return classMirror.klass;
}
if(declaration instanceof AnnotationProxyClass){
return getJavaClass(((AnnotationProxyClass) declaration).iface);
}
if(declaration.getContainer() instanceof com.redhat.ceylon.compiler.typechecker.model.Declaration){
return getJavaClass((com.redhat.ceylon.compiler.typechecker.model.Declaration)declaration.getContainer());
}
throw new RuntimeException("Unsupported declaration type: " + declaration);
throw new RuntimeException("Unsupported declaration type: " + declaration + " of type "+declaration.getClass());
}

public static java.lang.reflect.Method getJavaMethod(com.redhat.ceylon.compiler.typechecker.model.Method declaration) {
Expand Down
Expand Up @@ -143,5 +143,4 @@ private String cacheKeyByModule(String name, String version) {
public Unit getUnit() {
return typeFactory;
}

}

0 comments on commit 8401d6b

Please sign in to comment.