Minor: fixed tests.
This commit is contained in:
@@ -1266,6 +1266,16 @@ public abstract class Number {
|
||||
public abstract fun toShort(): kotlin.Short
|
||||
}
|
||||
|
||||
private open class OldUnit {
|
||||
/*primary*/ public constructor OldUnit()
|
||||
|
||||
private class object <class-object-for-OldUnit> {
|
||||
/*primary*/ private constructor <class-object-for-OldUnit>()
|
||||
public final val VALUE: kotlin.Unit
|
||||
public final fun <get-VALUE>(): kotlin.Unit
|
||||
}
|
||||
}
|
||||
|
||||
public trait Progression</*0*/ out N : kotlin.Any> : kotlin.Iterable<N> {
|
||||
public abstract val end: N
|
||||
public abstract fun <get-end>(): N
|
||||
@@ -1450,13 +1460,15 @@ public open class Throwable {
|
||||
public final fun printStackTrace(): kotlin.Unit
|
||||
}
|
||||
|
||||
public final class Unit {
|
||||
public object Unit : kotlin.OldUnit {
|
||||
/*primary*/ private constructor Unit()
|
||||
public final val VALUE: kotlin.Unit
|
||||
public final fun <get-VALUE>(): kotlin.Unit
|
||||
|
||||
public class object <class-object-for-Unit> {
|
||||
public class object <class-object-for-Unit> : kotlin.Unit {
|
||||
/*primary*/ private constructor <class-object-for-Unit>()
|
||||
public final val VALUE: kotlin.Unit
|
||||
public final fun <get-VALUE>(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ val VALUE: kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ fun <get-VALUE>(): kotlin.Unit
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
import org.jetbrains.jet.plugin.caches.JetShortNamesCache;
|
||||
import org.jetbrains.jet.plugin.caches.resolve.ResolvePackage;
|
||||
@@ -176,6 +177,9 @@ class CompletionSession {
|
||||
|
||||
if (descriptor instanceof ClassDescriptor) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) descriptor;
|
||||
|
||||
if (KotlinBuiltIns.getInstance().isUnit(classDescriptor.getDefaultType())) return true;
|
||||
|
||||
ClassKind kind = classDescriptor.getKind();
|
||||
return !(kind == ClassKind.OBJECT || kind == ClassKind.CLASS_OBJECT);
|
||||
}
|
||||
|
||||
@@ -174,14 +174,14 @@ public class BuiltInsReferenceResolver extends AbstractProjectComponent {
|
||||
|
||||
@Nullable
|
||||
private DeclarationDescriptor findCurrentDescriptorForClass(@NotNull ClassDescriptor originalDescriptor) {
|
||||
if (originalDescriptor.getKind().isSingleton()) {
|
||||
// BindingContext doesn't contain an information about class descriptor of class object. For example see testEmptyRange.
|
||||
if (DescriptorUtils.isClassObject(originalDescriptor)) {
|
||||
DeclarationDescriptor currentParent = findCurrentDescriptor(originalDescriptor.getContainingDeclaration());
|
||||
if (currentParent == null) return null;
|
||||
return ((ClassDescriptor) currentParent).getClassObjectDescriptor();
|
||||
}
|
||||
else {
|
||||
return bindingContext.get(BindingContext.FQNAME_TO_CLASS_DESCRIPTOR, DescriptorUtils.getFqName(originalDescriptor));
|
||||
}
|
||||
|
||||
return bindingContext.get(BindingContext.FQNAME_TO_CLASS_DESCRIPTOR, DescriptorUtils.getFqName(originalDescriptor));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user