Lines 651-657
Link Here
|
651 |
int impossible = this.isErasureMatch ? ERASURE_MATCH : IMPOSSIBLE_MATCH; |
651 |
int impossible = this.isErasureMatch ? ERASURE_MATCH : IMPOSSIBLE_MATCH; |
652 |
|
652 |
|
653 |
// pattern has type parameter(s) or type argument(s) |
653 |
// pattern has type parameter(s) or type argument(s) |
654 |
boolean isRawType = type.isRawType(); |
|
|
655 |
if (type.isGenericType()) { |
654 |
if (type.isGenericType()) { |
656 |
// Binding is generic, get its type variable(s) |
655 |
// Binding is generic, get its type variable(s) |
657 |
TypeVariableBinding[] typeVariables = null; |
656 |
TypeVariableBinding[] typeVariables = null; |
Lines 669-682
Link Here
|
669 |
} |
668 |
} |
670 |
// TODO (frederic) do we need to verify each parameter? |
669 |
// TODO (frederic) do we need to verify each parameter? |
671 |
return level; // we can't do better |
670 |
return level; // we can't do better |
672 |
} else if (isRawType) { |
671 |
} else if (type.isRawType()) { |
673 |
return level; // raw type always match |
672 |
return level; // raw type always match |
674 |
} else if (!type.isParameterizedType()) { |
673 |
} else if (!type.isParameterizedType() && !(type.isArrayType() && ((ArrayBinding)type).leafComponentType.isParameterizedType())) { |
675 |
// Standard types (ie. neither generic nor parameterized nor raw types) |
674 |
// Standard types (ie. neither generic nor parameterized nor raw types) |
676 |
// cannot match pattern with type parameters or arguments |
675 |
// cannot match pattern with type parameters or arguments |
677 |
return (patternTypeArguments[depth]==null || patternTypeArguments[depth].length==0) ? level : IMPOSSIBLE_MATCH; |
676 |
return (patternTypeArguments[depth]==null || patternTypeArguments[depth].length==0) ? level : IMPOSSIBLE_MATCH; |
678 |
} else { |
677 |
} else { |
679 |
ParameterizedTypeBinding paramTypeBinding = (ParameterizedTypeBinding) type; |
678 |
ParameterizedTypeBinding paramTypeBinding = (ParameterizedTypeBinding) (type.isArrayType() ? ((ArrayBinding)type).leafComponentType : type); |
680 |
|
679 |
|
681 |
// Compare arguments only if there ones on both sides |
680 |
// Compare arguments only if there ones on both sides |
682 |
if (patternTypeArguments[depth] != null && patternTypeArguments[depth].length > 0 && |
681 |
if (patternTypeArguments[depth] != null && patternTypeArguments[depth].length > 0 && |