Throw error for conflict in variances to combine

This commit is contained in:
Svetlana Isakova
2014-12-10 21:45:13 +03:00
parent c097e6ee3e
commit 8b0707b15d
@@ -286,8 +286,8 @@ public class TypeSubstitutor {
if (typeParameterVariance == Variance.INVARIANT) return projectionKind;
if (projectionKind == Variance.INVARIANT) return typeParameterVariance;
if (typeParameterVariance == projectionKind) return projectionKind;
//todo ask why?
return Variance.IN_VARIANCE;
throw new AssertionError("Variance conflict: type parameter variance '" + typeParameterVariance + "' and " +
"projection kind '" + projectionKind + "' cannot be combined");
}
private enum VarianceConflictType {