Minor: remove a couple of usages of KotlinBuiltIns.getInstance()

This commit is contained in:
Pavel V. Talanov
2015-06-29 19:26:20 +03:00
parent c19785252c
commit 44dffa7bbc
4 changed files with 25 additions and 22 deletions
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.load.java.lazy.descriptors
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
@@ -180,7 +179,7 @@ public abstract class LazyJavaMemberScope(
val paramType = javaParameter.getType() as? JavaArrayType
?: throw AssertionError("Vararg parameter should be an array: $javaParameter")
val outType = c.typeResolver.transformArrayType(paramType, typeUsage, true)
outType to KotlinBuiltIns.getInstance().getArrayElementType(outType)
outType to c.module.builtIns.getArrayElementType(outType)
}
else {
c.typeResolver.transformJavaType(javaParameter.getType(), typeUsage) to null
@@ -188,7 +187,7 @@ public abstract class LazyJavaMemberScope(
val name = if (function.getName().asString() == "equals" &&
jValueParameters.size() == 1 &&
KotlinBuiltIns.getInstance().getNullableAnyType() == outType) {
c.module.builtIns.getNullableAnyType() == outType) {
// This is a hack to prevent numerous warnings on Kotlin classes that inherit Java classes: if you override "equals" in such
// class without this hack, you'll be warned that in the superclass the name is "p0" (regardless of the fact that it's
// "other" in Any)
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.descriptors.impl;
import kotlin.jvm.functions.Function0;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.ReadOnly;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorVisitor;
import org.jetbrains.kotlin.descriptors.SourceElement;
@@ -36,6 +35,8 @@ import org.jetbrains.kotlin.types.checker.JetTypeChecker;
import java.util.Collections;
import java.util.Set;
import static org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilPackage.getBuiltIns;
public abstract class AbstractTypeParameterDescriptor extends DeclarationDescriptorNonRootImpl implements TypeParameterDescriptor {
private final Variance variance;
private final boolean reified;
@@ -135,7 +136,7 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip
Set<JetType> upperBounds = getUpperBounds();
assert !upperBounds.isEmpty() : "Upper bound list is empty in " + getName();
JetType upperBoundsAsType = TypeUtils.intersect(JetTypeChecker.DEFAULT, upperBounds);
return upperBoundsAsType != null ? upperBoundsAsType : KotlinBuiltIns.getInstance().getNothingType();
return upperBoundsAsType != null ? upperBoundsAsType : getBuiltIns(this).getNothingType();
}
@NotNull
@@ -153,7 +154,7 @@ public abstract class AbstractTypeParameterDescriptor extends DeclarationDescrip
@NotNull
@Override
public Set<JetType> getLowerBounds() {
return Collections.singleton(KotlinBuiltIns.getInstance().getNothingType());
return Collections.singleton(getBuiltIns(this).getNothingType());
}
@NotNull