mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 01:43:13 +00:00
8007546: ClassCastException on JSR308 tests
8015993: jck-compiler tests are failed with java.lang.ClassCastException Fix ClassCastExceptions arising from addition of AnnotatedType. Reviewed-by: jjg, abuckley
This commit is contained in:
parent
1a284a49c9
commit
bca53c33de
@ -3206,7 +3206,7 @@ public class Attr extends JCTree.Visitor {
|
||||
if (skind == TYP) {
|
||||
Type elt = site;
|
||||
while (elt.hasTag(ARRAY))
|
||||
elt = ((ArrayType)elt).elemtype;
|
||||
elt = ((ArrayType)elt.unannotatedType()).elemtype;
|
||||
if (elt.hasTag(TYPEVAR)) {
|
||||
log.error(tree.pos(), "type.var.cant.be.deref");
|
||||
result = types.createErrorType(tree.type);
|
||||
|
||||
@ -919,11 +919,15 @@ public class Code {
|
||||
if (o instanceof Long) return syms.longType;
|
||||
if (o instanceof Double) return syms.doubleType;
|
||||
if (o instanceof ClassSymbol) return syms.classType;
|
||||
if (o instanceof Type.ArrayType) return syms.classType;
|
||||
if (o instanceof Type.MethodType) return syms.methodTypeType;
|
||||
if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type);
|
||||
if (o instanceof Pool.MethodHandle) return syms.methodHandleType;
|
||||
throw new AssertionError(o);
|
||||
if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type);
|
||||
if (o instanceof Type) {
|
||||
Type ty = ((Type)o).unannotatedType();
|
||||
|
||||
if (ty instanceof Type.ArrayType) return syms.classType;
|
||||
if (ty instanceof Type.MethodType) return syms.methodTypeType;
|
||||
}
|
||||
throw new AssertionError("Invalid type of constant pool entry: " + o.getClass());
|
||||
}
|
||||
|
||||
/** Emit an opcode with a one-byte operand field;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user