View | Details | Raw Unified | Return to bug 104695
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java (-1 / +11 lines)
Lines 81-87 Link Here
81
		if (expressionType == null || checkedType == null)
81
		if (expressionType == null || checkedType == null)
82
			return null;
82
			return null;
83
83
84
		if (checkedType.isTypeVariable() || checkedType.isBoundParameterizedType() || checkedType.isGenericType()) {
84
		if (checkedType.isArrayType()) {
85
			TypeBinding leafType = checkedType.leafComponentType();
86
			if (leafType.isTypeVariable() || leafType.isBoundParameterizedType() || leafType.isGenericType()) {
87
				scope.problemReporter().illegalInstanceOfGenericType(checkedType, this);
88
			} else {
89
				boolean isLegal = checkCastTypesCompatibility(scope, checkedType, expressionType, null);
90
				if (!isLegal) {
91
					scope.problemReporter().notCompatibleTypesError(this, expressionType, checkedType);
92
				}
93
			}
94
		} else if (checkedType.isTypeVariable() || checkedType.isBoundParameterizedType() || checkedType.isGenericType()) {
85
			scope.problemReporter().illegalInstanceOfGenericType(checkedType, this);
95
			scope.problemReporter().illegalInstanceOfGenericType(checkedType, this);
86
		} else {
96
		} else {
87
			boolean isLegal = checkCastTypesCompatibility(scope, checkedType, expressionType, null);
97
			boolean isLegal = checkCastTypesCompatibility(scope, checkedType, expressionType, null);

Return to bug 104695