Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTypeMirror.java @ 16923:93e061157811
Truffle-DSL: better support for types with type arguments.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 25 Aug 2014 20:59:56 +0200 |
parents | 23415229349b |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTypeMirror.java Mon Aug 25 16:30:40 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/model/CodeTypeMirror.java Mon Aug 25 20:59:56 2014 +0200 @@ -46,6 +46,27 @@ throw new UnsupportedOperationException(); } + public static class WildcardTypeMirror extends CodeTypeMirror implements WildcardType { + + private final TypeMirror extendsBounds; + private final TypeMirror superBounds; + + public WildcardTypeMirror(TypeMirror extendsBounds, TypeMirror superBounds) { + super(TypeKind.WILDCARD); + this.extendsBounds = extendsBounds; + this.superBounds = superBounds; + } + + public TypeMirror getExtendsBound() { + return extendsBounds; + } + + public TypeMirror getSuperBound() { + return superBounds; + } + + } + public static class ArrayCodeTypeMirror extends CodeTypeMirror implements ArrayType { private final TypeMirror component; @@ -65,13 +86,13 @@ public static class DeclaredCodeTypeMirror extends CodeTypeMirror implements DeclaredType { private final TypeElement clazz; - private final List<? extends TypeMirror> typeArguments; + private final List<TypeMirror> typeArguments; public DeclaredCodeTypeMirror(TypeElement clazz) { this(clazz, Collections.<TypeMirror> emptyList()); } - public DeclaredCodeTypeMirror(TypeElement clazz, List<? extends TypeMirror> typeArguments) { + public DeclaredCodeTypeMirror(TypeElement clazz, List<TypeMirror> typeArguments) { super(TypeKind.DECLARED); this.clazz = clazz; this.typeArguments = typeArguments; @@ -88,7 +109,7 @@ } @Override - public List<? extends TypeMirror> getTypeArguments() { + public List<TypeMirror> getTypeArguments() { return typeArguments; }