Merge remote branch 'origin/master'

This commit is contained in:
Alex Tkachman
2011-12-01 17:27:12 +02:00
4 changed files with 17 additions and 0 deletions
@@ -343,6 +343,11 @@ public class TypeUtils {
private static void fillInDeepSubstitutor(@NotNull JetType context, @NotNull TypeSubstitutor substitutor, @NotNull Map<TypeConstructor, TypeProjection> substitution, @Nullable Multimap<TypeConstructor, TypeProjection> fullSubstitution) {
List<TypeParameterDescriptor> parameters = context.getConstructor().getParameters();
List<TypeProjection> arguments = context.getArguments();
if (parameters.size() != arguments.size()) {
throw new IllegalStateException();
}
for (int i = 0; i < arguments.size(); i++) {
TypeProjection argument = arguments.get(i);
TypeParameterDescriptor typeParameterDescriptor = parameters.get(i);
@@ -266,6 +266,11 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
return false;
}
// do not crash on error types
if (ErrorUtils.isErrorType(actualType) || ErrorUtils.isErrorType(targetType)) {
return false;
}
{
Multimap<TypeConstructor, TypeProjection> typeSubstitutionMap =
TypeUtils.buildDeepSubstitutionMultimap(targetType);
@@ -0,0 +1,7 @@
// +JDK
import java.util.Collection;
import java.util.List;
fun ff<T>(l: Collection<T>) = l is List<T>