Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java @ 16830:c3c07046a74b
Truffle-DSL: fixed guard solve of guards for interfaces.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 14 Aug 2014 15:02:17 +0200 |
parents | 28e29a4b0b97 |
children | 2db61eddcb97 7de44804d9fa |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java Thu Aug 14 13:11:47 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java Thu Aug 14 15:02:17 2014 +0200 @@ -593,11 +593,16 @@ } else if (type.getKind() == TypeKind.ARRAY) { return Arrays.asList(type, context.getType(Object.class)); } else if (type.getKind() == TypeKind.DECLARED) { - List<TypeElement> types = getSuperTypes(fromTypeMirror(type)); + DeclaredType declaredType = (DeclaredType) type; + TypeElement typeElement = fromTypeMirror(declaredType); + List<TypeElement> types = getSuperTypes(typeElement); List<TypeMirror> mirrors = new ArrayList<>(types.size()); mirrors.add(type); - for (TypeElement typeElement : types) { - mirrors.add(typeElement.asType()); + for (TypeElement superTypeElement : types) { + mirrors.add(superTypeElement.asType()); + } + if (typeElement.getKind().isInterface()) { + mirrors.add(getType(context.getEnvironment(), Object.class)); } return mirrors; } else {