Fix KotlinBuiltIns.isUnit
It didn't check type's nullability
This commit is contained in:
@@ -24,14 +24,10 @@ import org.jetbrains.jet.lang.DefaultModuleConfiguration;
|
||||
import org.jetbrains.jet.lang.ModuleConfiguration;
|
||||
import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.NamespaceDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
import org.jetbrains.jet.lang.resolve.constants.EnumValue;
|
||||
import org.jetbrains.jet.storage.LockBasedStorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.name.SpecialNames;
|
||||
@@ -40,6 +36,7 @@ import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
import org.jetbrains.jet.storage.LockBasedStorageManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
@@ -948,8 +945,7 @@ public class KotlinBuiltIns {
|
||||
}
|
||||
|
||||
public boolean isUnit(@NotNull JetType type) {
|
||||
return !(type instanceof NamespaceType) &&
|
||||
type.getConstructor() == getUnitType().getConstructor();
|
||||
return !(type instanceof NamespaceType) && type.equals(getUnitType());
|
||||
}
|
||||
|
||||
public boolean isData(@NotNull ClassDescriptor classDescriptor) {
|
||||
|
||||
Reference in New Issue
Block a user