Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
16829:e3724f25056a | 16830:c3c07046a74b |
---|---|
591 if (isPrimitive(type)) { | 591 if (isPrimitive(type)) { |
592 return Arrays.asList(type, boxType(context, type), context.getType(Object.class)); | 592 return Arrays.asList(type, boxType(context, type), context.getType(Object.class)); |
593 } else if (type.getKind() == TypeKind.ARRAY) { | 593 } else if (type.getKind() == TypeKind.ARRAY) { |
594 return Arrays.asList(type, context.getType(Object.class)); | 594 return Arrays.asList(type, context.getType(Object.class)); |
595 } else if (type.getKind() == TypeKind.DECLARED) { | 595 } else if (type.getKind() == TypeKind.DECLARED) { |
596 List<TypeElement> types = getSuperTypes(fromTypeMirror(type)); | 596 DeclaredType declaredType = (DeclaredType) type; |
597 TypeElement typeElement = fromTypeMirror(declaredType); | |
598 List<TypeElement> types = getSuperTypes(typeElement); | |
597 List<TypeMirror> mirrors = new ArrayList<>(types.size()); | 599 List<TypeMirror> mirrors = new ArrayList<>(types.size()); |
598 mirrors.add(type); | 600 mirrors.add(type); |
599 for (TypeElement typeElement : types) { | 601 for (TypeElement superTypeElement : types) { |
600 mirrors.add(typeElement.asType()); | 602 mirrors.add(superTypeElement.asType()); |
603 } | |
604 if (typeElement.getKind().isInterface()) { | |
605 mirrors.add(getType(context.getEnvironment(), Object.class)); | |
601 } | 606 } |
602 return mirrors; | 607 return mirrors; |
603 } else { | 608 } else { |
604 return Collections.emptyList(); | 609 return Collections.emptyList(); |
605 } | 610 } |