Index: Expression.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java,v retrieving revision 1.58 diff -u -r1.58 Expression.java --- Expression.java 10 Jan 2005 12:20:51 -0000 1.58 +++ Expression.java 10 Jan 2005 20:57:53 -0000 @@ -297,7 +297,12 @@ exprElementType, expression); } else if (castType.isTypeVariable()) { - TypeBinding match = ((ReferenceBinding)expressionType).findSuperTypeErasingTo((ReferenceBinding)castType); + TypeBinding leafType = ((ArrayBinding) expressionType).leafComponentType(); + if (leafType.isBaseType()) { + reportIllegalCast(scope, castType, expressionType); + return false; + } + TypeBinding match = ((ReferenceBinding)leafType).findSuperTypeErasingTo((ReferenceBinding)castType); if (match == null) { checkUnsafeCast(scope, castType, expressionType, match, true); }