Don't crash compiling incorrect code. This is very important for jet.as.java.psi component

This commit is contained in:
Maxim Shafirov
2012-01-13 17:30:02 +04:00
parent db8848f3af
commit 8e85962856
@@ -20,7 +20,6 @@ import org.jetbrains.jet.lang.types.*;
import org.jetbrains.jet.lexer.JetTokens;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.Method;
import java.util.*;
@@ -247,7 +246,7 @@ public class JetTypeMapper {
DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor();
if (ErrorUtils.isError(descriptor)) {
throw new IllegalStateException("should not compile an error type");
return Type.getObjectType("error/NonExistentClass");
}
if (standardLibrary.getArray().equals(descriptor)) {