rename Kt to Kotlin in KtType, KtIcons

This commit is contained in:
Dmitry Jemerov
2015-10-20 16:23:25 +02:00
parent 9d7a8e7696
commit d6a3870101
457 changed files with 2831 additions and 2830 deletions
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtSuperExpression
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.types.KtType
import org.jetbrains.kotlin.types.KotlinType
public class AccessorForConstructorDescriptor(
private val calleeDescriptor: ConstructorDescriptor,
@@ -35,7 +35,7 @@ public class AccessorForConstructorDescriptor(
override fun isPrimary(): Boolean = false
override fun getReturnType(): KtType = super.getReturnType()!!
override fun getReturnType(): KotlinType = super.getReturnType()!!
override fun getSuperCallExpression(): KtSuperExpression? = superCallExpression
@@ -20,13 +20,13 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.descriptors.PropertyDescriptor;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
public class AccessorForPropertyBackingFieldInOuterClass extends AccessorForPropertyDescriptor {
public AccessorForPropertyBackingFieldInOuterClass(
@NotNull PropertyDescriptor property,
@NotNull DeclarationDescriptor containingDeclaration,
@Nullable KtType delegationType,
@Nullable KotlinType delegationType,
@NotNull String nameSuffix
) {
super(property, delegationType != null ? delegationType : property.getType(), null, null, containingDeclaration, null, nameSuffix);
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.psi.KtSuperExpression;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import java.util.Collections;
@@ -48,8 +48,8 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem
protected AccessorForPropertyDescriptor(
@NotNull PropertyDescriptor original,
@NotNull KtType propertyType,
@Nullable KtType receiverType,
@NotNull KotlinType propertyType,
@Nullable KotlinType receiverType,
@Nullable ReceiverParameterDescriptor dispatchReceiverParameter,
@NotNull DeclarationDescriptor containingDeclaration,
@Nullable KtSuperExpression superCallExpression,
@@ -157,7 +157,7 @@ public abstract class AnnotationCodegen {
return false;
}
private void generateNullabilityAnnotation(@Nullable KtType type, @NotNull Set<String> annotationDescriptorsAlreadyPresent) {
private void generateNullabilityAnnotation(@Nullable KotlinType type, @NotNull Set<String> annotationDescriptorsAlreadyPresent) {
if (type == null) return;
if (isBareTypeParameterWithNullableUpperBound(type)) {
@@ -253,12 +253,12 @@ public abstract class AnnotationCodegen {
}
}
private static boolean isBareTypeParameterWithNullableUpperBound(@NotNull KtType type) {
private static boolean isBareTypeParameterWithNullableUpperBound(@NotNull KotlinType type) {
ClassifierDescriptor classifier = type.getConstructor().getDeclarationDescriptor();
return !type.isMarkedNullable() && classifier instanceof TypeParameterDescriptor && TypeUtils.hasNullableSuperType(type);
}
public void generateAnnotationDefaultValue(@NotNull ConstantValue<?> value, @NotNull KtType expectedType) {
public void generateAnnotationDefaultValue(@NotNull ConstantValue<?> value, @NotNull KotlinType expectedType) {
AnnotationVisitor visitor = visitAnnotation(null, false); // Parameters are unimportant
genCompileTimeValue(null, value, visitor);
visitor.visitEnd();
@@ -418,7 +418,7 @@ public abstract class AnnotationCodegen {
for (ConstantValue<?> value : values) {
if (value instanceof EnumValue) {
ClassDescriptor enumEntry = ((EnumValue) value).getValue();
KtType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry);
KotlinType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry);
if (classObjectType != null) {
if ("java/lang/annotation/ElementType".equals(typeMapper.mapType(classObjectType).getInternalName())) {
result.add(ElementType.valueOf(enumEntry.getName().asString()));
@@ -446,7 +446,7 @@ public abstract class AnnotationCodegen {
ConstantValue<?> compileTimeConstant = valueArguments.iterator().next();
if (compileTimeConstant instanceof EnumValue) {
ClassDescriptor enumEntry = ((EnumValue) compileTimeConstant).getValue();
KtType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry);
KotlinType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry);
if (classObjectType != null) {
if ("java/lang/annotation/RetentionPolicy".equals(typeMapper.mapType(classObjectType).getInternalName())) {
return RetentionPolicy.valueOf(enumEntry.getName().asString());
@@ -52,7 +52,7 @@ import org.jetbrains.kotlin.serialization.DescriptorSerializer;
import org.jetbrains.kotlin.serialization.jvm.BitEncoding;
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor;
import org.jetbrains.kotlin.types.FlexibleTypesKt;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.*;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
import org.jetbrains.org.objectweb.asm.commons.Method;
@@ -432,7 +432,7 @@ public class AsmUtil {
allFields.add(Pair.create(CAPTURED_THIS_FIELD, typeMapper.mapType(captureThis)));
}
KtType captureReceiverType = closure.getCaptureReceiverType();
KotlinType captureReceiverType = closure.getCaptureReceiverType();
if (captureReceiverType != null) {
allFields.add(Pair.create(CAPTURED_RECEIVER_FIELD, typeMapper.mapType(captureReceiverType)));
}
@@ -638,7 +638,7 @@ public class AsmUtil {
@NotNull CallableDescriptor parameter,
@NotNull String name
) {
KtType type = parameter.getReturnType();
KotlinType type = parameter.getReturnType();
if (type == null || isNullableType(type)) return;
int index = frameMap.getIndex(parameter);
@@ -672,7 +672,7 @@ public class AsmUtil {
if (!isDeclaredInJava(descriptor)) return false;
KtType type = descriptor.getReturnType();
KotlinType type = descriptor.getReturnType();
if (type == null || isNullableType(FlexibleTypesKt.lowerIfFlexible(type))) return false;
Type asmType = state.getTypeMapper().mapReturnType(descriptor);
@@ -43,7 +43,7 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt;
import org.jetbrains.kotlin.resolve.scopes.KtScope;
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
import org.jetbrains.kotlin.serialization.ProtoBuf;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.util.OperatorNameConventions;
import org.jetbrains.kotlin.utils.FunctionsKt;
import org.jetbrains.org.objectweb.asm.AnnotationVisitor;
@@ -70,8 +70,8 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
private final FunctionDescriptor funDescriptor;
private final ClassDescriptor classDescriptor;
private final SamType samType;
private final KtType superClassType;
private final List<KtType> superInterfaceTypes;
private final KotlinType superClassType;
private final List<KotlinType> superInterfaceTypes;
private final FunctionDescriptor functionReferenceTarget;
private final FunctionGenerationStrategy strategy;
private final CalculatedClosure closure;
@@ -100,10 +100,10 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
this.strategy = strategy;
if (samType == null) {
this.superInterfaceTypes = new ArrayList<KtType>();
this.superInterfaceTypes = new ArrayList<KotlinType>();
KtType superClassType = null;
for (KtType supertype : classDescriptor.getTypeConstructor().getSupertypes()) {
KotlinType superClassType = null;
for (KotlinType supertype : classDescriptor.getTypeConstructor().getSupertypes()) {
ClassifierDescriptor classifier = supertype.getConstructor().getDeclarationDescriptor();
if (DescriptorUtils.isInterface(classifier)) {
superInterfaceTypes.add(supertype);
@@ -141,7 +141,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
sw.writeSuperclassEnd();
String[] superInterfaceAsmTypes = new String[superInterfaceTypes.size()];
for (int i = 0; i < superInterfaceTypes.size(); i++) {
KtType superInterfaceType = superInterfaceTypes.get(i);
KotlinType superInterfaceType = superInterfaceTypes.get(i);
sw.writeInterface();
superInterfaceAsmTypes[i] = typeMapper.mapSupertype(superInterfaceType, sw).getInternalName();
sw.writeInterfaceEnd();
@@ -428,7 +428,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
Type type = typeMapper.mapType(captureThis);
args.add(FieldInfo.createForHiddenField(ownerType, type, CAPTURED_THIS_FIELD));
}
KtType captureReceiverType = closure.getCaptureReceiverType();
KotlinType captureReceiverType = closure.getCaptureReceiverType();
if (captureReceiverType != null) {
args.add(FieldInfo.createForHiddenField(ownerType, typeMapper.mapType(captureReceiverType), CAPTURED_RECEIVER_FIELD));
}
@@ -187,7 +187,7 @@ class CollectionStubMethodGenerator(
return ourSuperCollectionClasses.filter { klass -> klass.readOnlyClass !in redundantClasses }
}
private fun Collection<KtType>.classes(): Collection<ClassDescriptor> =
private fun Collection<KotlinType>.classes(): Collection<ClassDescriptor> =
this.map { it.getConstructor().getDeclarationDescriptor() as ClassDescriptor }
private fun findFakeOverridesForMethodsFromMutableCollection(
@@ -213,7 +213,7 @@ class CollectionStubMethodGenerator(
return result
}
private fun Collection<KtType>.findMostSpecificTypeForClass(klass: ClassDescriptor): KtType {
private fun Collection<KotlinType>.findMostSpecificTypeForClass(klass: ClassDescriptor): KotlinType {
val types = this.filter { it.getConstructor().getDeclarationDescriptor() == klass }
if (types.isEmpty()) error("No supertype of $klass in $this")
if (types.size() == 1) return types.first()
@@ -239,8 +239,8 @@ class CollectionStubMethodGenerator(
return this.getOverriddenDescriptors().firstOrNull { it.getContainingDeclaration() == classDescriptor }
}
private fun newType(classDescriptor: ClassDescriptor, typeArguments: List<TypeProjection>): KtType {
return KtTypeImpl.create(Annotations.EMPTY, classDescriptor, false, typeArguments)
private fun newType(classDescriptor: ClassDescriptor, typeArguments: List<TypeProjection>): KotlinType {
return KotlinTypeImpl.create(Annotations.EMPTY, classDescriptor, false, typeArguments)
}
private fun FunctionDescriptor.signature(): JvmMethodSignature = typeMapper.mapSignature(this)
@@ -80,7 +80,7 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
import org.jetbrains.kotlin.resolve.scopes.receivers.*;
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.TypeProjection;
import org.jetbrains.kotlin.types.TypeUtils;
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker;
@@ -225,7 +225,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
private static void addReifiedParametersFromSignature(@NotNull MemberCodegen member, @NotNull ClassDescriptor descriptor) {
for (KtType type : descriptor.getTypeConstructor().getSupertypes()) {
for (KotlinType type : descriptor.getTypeConstructor().getSupertypes()) {
for (TypeProjection supertypeArgument : type.getArguments()) {
TypeParameterDescriptor parameterDescriptor = TypeUtils.getTypeParameterDescriptorOrNull(supertypeArgument.getType());
if (parameterDescriptor != null && parameterDescriptor.isReified()) {
@@ -377,18 +377,18 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
@NotNull
private Type asmType(@NotNull KtType type) {
private Type asmType(@NotNull KotlinType type) {
return typeMapper.mapType(type);
}
@NotNull
public Type expressionType(@Nullable KtExpression expression) {
KtType type = expressionJetType(expression);
KotlinType type = expressionJetType(expression);
return type == null ? Type.VOID_TYPE : asmType(type);
}
@Nullable
public KtType expressionJetType(@Nullable KtExpression expression) {
public KotlinType expressionJetType(@Nullable KtExpression expression) {
return expression != null ? bindingContext.getType(expression) : null;
}
@@ -543,7 +543,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
KtExpression loopRange = forExpression.getLoopRange();
assert loopRange != null;
KtType loopRangeType = bindingContext.getType(loopRange);
KotlinType loopRangeType = bindingContext.getType(loopRange);
assert loopRangeType != null;
Type asmLoopRangeType = asmType(loopRangeType);
if (asmLoopRangeType.getSort() == Type.ARRAY) {
@@ -604,7 +604,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
private final Label bodyEnd = new Label();
private final List<Runnable> leaveVariableTasks = Lists.newArrayList();
protected final KtType elementType;
protected final KotlinType elementType;
protected final Type asmElementType;
protected int loopParameterVar;
@@ -616,7 +616,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
@NotNull
private KtType getElementType(KtForExpression forExpression) {
private KotlinType getElementType(KtForExpression forExpression) {
KtExpression loopRange = forExpression.getLoopRange();
assert loopRange != null;
ResolvedCall<FunctionDescriptor> nextCall = getNotNull(bindingContext,
@@ -765,7 +765,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
LOOP_RANGE_ITERATOR_RESOLVED_CALL, loopRange,
"No .iterator() function " + DiagnosticUtils.atLocation(loopRange));
KtType iteratorType = iteratorCall.getResultingDescriptor().getReturnType();
KotlinType iteratorType = iteratorCall.getResultingDescriptor().getReturnType();
assert iteratorType != null;
this.asmTypeForIterator = asmType(iteratorType);
@@ -802,7 +802,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
result.put(result.type, v);
FunctionDescriptor hasNext = hasNextCall.getResultingDescriptor();
KtType type = hasNext.getReturnType();
KotlinType type = hasNext.getReturnType();
assert type != null && KotlinTypeChecker.DEFAULT.isSubtypeOf(type, DescriptorUtilsKt.getBuiltIns(hasNext).getBooleanType());
Type asmType = asmType(type);
@@ -827,7 +827,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
private class ForInArrayLoopGenerator extends AbstractForLoopGenerator {
private int indexVar;
private int arrayVar;
private final KtType loopRangeType;
private final KotlinType loopRangeType;
private ForInArrayLoopGenerator(@NotNull KtForExpression forExpression) {
super(forExpression);
@@ -1042,7 +1042,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
@Override
protected void storeRangeStartAndEnd() {
KtType loopRangeType = bindingContext.getType(forExpression.getLoopRange());
KotlinType loopRangeType = bindingContext.getType(forExpression.getLoopRange());
assert loopRangeType != null;
Type asmLoopRangeType = asmType(loopRangeType);
gen(forExpression.getLoopRange(), asmLoopRangeType);
@@ -1074,7 +1074,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
incrementVar = createLoopTempVariable(asmElementType);
KtType loopRangeType = bindingContext.getType(forExpression.getLoopRange());
KotlinType loopRangeType = bindingContext.getType(forExpression.getLoopRange());
assert loopRangeType != null;
Type asmLoopRangeType = asmType(loopRangeType);
@@ -1308,7 +1308,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
if (compileTimeValue == null) {
return null;
}
KtType expectedType = bindingContext.getType(expression);
KotlinType expectedType = bindingContext.getType(expression);
return compileTimeValue.toConstantValue(expectedType);
}
@@ -1515,7 +1515,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
}
KtType captureReceiver = closure.getCaptureReceiverType();
KotlinType captureReceiver = closure.getCaptureReceiverType();
if (captureReceiver != null) {
Type asmType = typeMapper.mapType(captureReceiver);
StackValue.Local capturedReceiver = StackValue.local(AsmUtil.getReceiverIndex(context, context.getContextDescriptor()), asmType);
@@ -1998,7 +1998,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
Collection<ExpressionCodegenExtension> codegenExtensions = ExpressionCodegenExtension.Companion.getInstances(state.getProject());
if (!codegenExtensions.isEmpty() && resolvedCall != null) {
ExpressionCodegenExtension.Context context = new ExpressionCodegenExtension.Context(typeMapper, v);
KtType returnType = propertyDescriptor.getReturnType();
KotlinType returnType = propertyDescriptor.getReturnType();
for (ExpressionCodegenExtension extension : codegenExtensions) {
if (returnType != null) {
StackValue value = extension.applyProperty(receiver, resolvedCall, context);
@@ -2103,7 +2103,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
private StackValue stackValueForLocal(DeclarationDescriptor descriptor, int index) {
if (descriptor instanceof VariableDescriptor) {
Type sharedVarType = typeMapper.getSharedVarType(descriptor);
KtType outType = ((VariableDescriptor) descriptor).getType();
KotlinType outType = ((VariableDescriptor) descriptor).getType();
if (sharedVarType != null) {
return StackValue.shared(index, asmType(outType));
}
@@ -2126,7 +2126,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
@Nullable
private static KtType getPropertyDelegateType(@NotNull PropertyDescriptor descriptor, @NotNull BindingContext bindingContext) {
private static KotlinType getPropertyDelegateType(@NotNull PropertyDescriptor descriptor, @NotNull BindingContext bindingContext) {
PropertyGetterDescriptor getter = descriptor.getGetter();
if (getter != null) {
Call call = bindingContext.get(DELEGATED_PROPERTY_CALL, getter);
@@ -2164,7 +2164,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
boolean isSuper = superExpression != null;
boolean isExtensionProperty = propertyDescriptor.getExtensionReceiverParameter() != null;
KtType delegateType = getPropertyDelegateType(propertyDescriptor, bindingContext);
KotlinType delegateType = getPropertyDelegateType(propertyDescriptor, bindingContext);
boolean isDelegatedProperty = delegateType != null;
CallableMethod callableGetter = null;
@@ -2504,13 +2504,13 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
@NotNull
private CallGenerator getOrCreateCallGenerator(@NotNull ResolvedCall<?> resolvedCall) {
Map<TypeParameterDescriptor, KtType> typeArguments = resolvedCall.getTypeArguments();
Map<TypeParameterDescriptor, KotlinType> typeArguments = resolvedCall.getTypeArguments();
ReifiedTypeParameterMappings mappings = new ReifiedTypeParameterMappings();
for (Map.Entry<TypeParameterDescriptor, KtType> entry : typeArguments.entrySet()) {
for (Map.Entry<TypeParameterDescriptor, KotlinType> entry : typeArguments.entrySet()) {
TypeParameterDescriptor key = entry.getKey();
if (!key.isReified()) continue;
KtType type = entry.getValue();
KotlinType type = entry.getValue();
TypeParameterDescriptor parameterDescriptor = TypeUtils.getTypeParameterDescriptorOrNull(type);
if (parameterDescriptor == null) {
// type is not generic
@@ -2667,7 +2667,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
public void genVarargs(@NotNull VarargValueArgument valueArgument, @NotNull KtType outType) {
public void genVarargs(@NotNull VarargValueArgument valueArgument, @NotNull KotlinType outType) {
Type type = asmType(outType);
assert type.getSort() == Type.ARRAY;
Type elementType = correctElementType(type);
@@ -2761,7 +2761,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
@Override
public StackValue visitClassLiteralExpression(@NotNull KtClassLiteralExpression expression, StackValue data) {
KtType type = bindingContext.getType(expression);
KotlinType type = bindingContext.getType(expression);
assert type != null;
assert state.getReflectionTypes().getKClass().getTypeConstructor().equals(type.getConstructor())
@@ -2813,7 +2813,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
@NotNull
public static StackValue generateClassLiteralReference(@NotNull final JetTypeMapper typeMapper, @NotNull final KtType type) {
public static StackValue generateClassLiteralReference(@NotNull final JetTypeMapper typeMapper, @NotNull final KotlinType type) {
return StackValue.operation(K_CLASS_TYPE, new Function1<InstructionAdapter, Unit>() {
@Override
public Unit invoke(InstructionAdapter v) {
@@ -3312,7 +3312,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
KtExpression initializer = multiDeclaration.getInitializer();
if (initializer == null) return StackValue.none();
KtType initializerType = bindingContext.getType(initializer);
KotlinType initializerType = bindingContext.getType(initializer);
assert initializerType != null;
Type initializerAsmType = asmType(initializerType);
@@ -3427,7 +3427,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
});
}
public StackValue generateNewArray(@NotNull KtCallExpression expression, @NotNull final KtType arrayType) {
public StackValue generateNewArray(@NotNull KtCallExpression expression, @NotNull final KotlinType arrayType) {
assert expression.getValueArguments().size() == 1 : "Size argument expected";
final KtExpression sizeExpression = expression.getValueArguments().get(0).getArgumentExpression();
@@ -3443,9 +3443,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
});
}
public void newArrayInstruction(@NotNull KtType arrayType) {
public void newArrayInstruction(@NotNull KotlinType arrayType) {
if (KotlinBuiltIns.isArray(arrayType)) {
KtType elementJetType = arrayType.getArguments().get(0).getType();
KotlinType elementJetType = arrayType.getArguments().get(0).getType();
putReifierMarkerIfTypeIsReifiedParameter(
elementJetType,
ReifiedTypeInliner.NEW_ARRAY_MARKER_METHOD_NAME
@@ -3461,7 +3461,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
@Override
public StackValue visitArrayAccessExpression(@NotNull KtArrayAccessExpression expression, StackValue receiver) {
KtExpression array = expression.getArrayExpression();
KtType type = array != null ? bindingContext.getType(array) : null;
KotlinType type = array != null ? bindingContext.getType(array) : null;
Type arrayType = expressionType(array);
List<KtExpression> indices = expression.getIndexExpressions();
FunctionDescriptor operationDescriptor = (FunctionDescriptor) bindingContext.get(REFERENCE_TARGET, expression);
@@ -3472,7 +3472,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
assert type != null;
Type elementType;
if (KotlinBuiltIns.isArray(type)) {
KtType jetElementType = type.getArguments().get(0).getType();
KotlinType jetElementType = type.getArguments().get(0).getType();
elementType = boxType(asmType(jetElementType));
}
else {
@@ -3564,7 +3564,7 @@ The "returned" value of try expression with no finally is either the last expres
(or blocks).
*/
KtType jetType = bindingContext.getType(expression);
KotlinType jetType = bindingContext.getType(expression);
assert jetType != null;
final Type expectedAsmType = isStatement ? Type.VOID_TYPE : asmType(jetType);
@@ -3706,7 +3706,7 @@ The "returned" value of try expression with no finally is either the last expres
KtExpression left = expression.getLeft();
final IElementType opToken = expression.getOperationReference().getReferencedNameElementType();
final KtType rightType = bindingContext.get(TYPE, expression.getRight());
final KotlinType rightType = bindingContext.get(TYPE, expression.getRight());
assert rightType != null;
final StackValue value = genQualified(receiver, left);
@@ -3756,7 +3756,7 @@ The "returned" value of try expression with no finally is either the last expres
if (expressionToMatch != null) {
Type subjectType = expressionToMatch.type;
markStartLineNumber(patternExpression);
KtType condJetType = bindingContext.getType(patternExpression);
KotlinType condJetType = bindingContext.getType(patternExpression);
Type condType;
if (isNumberPrimitive(subjectType) || subjectType.getSort() == Type.BOOLEAN) {
assert condJetType != null;
@@ -3777,13 +3777,13 @@ The "returned" value of try expression with no finally is either the last expres
}
private StackValue generateIsCheck(StackValue expressionToMatch, KtTypeReference typeReference, boolean negated) {
KtType jetType = bindingContext.get(TYPE, typeReference);
KotlinType jetType = bindingContext.get(TYPE, typeReference);
markStartLineNumber(typeReference);
StackValue value = generateInstanceOf(expressionToMatch, jetType, false);
return negated ? StackValue.not(value) : value;
}
private StackValue generateInstanceOf(final StackValue expressionToGen, final KtType jetType, final boolean leaveExpressionOnStack) {
private StackValue generateInstanceOf(final StackValue expressionToGen, final KotlinType jetType, final boolean leaveExpressionOnStack) {
return StackValue.operation(Type.BOOLEAN_TYPE, new Function1<InstructionAdapter, Unit>() {
@Override
public Unit invoke(InstructionAdapter v) {
@@ -3812,14 +3812,14 @@ The "returned" value of try expression with no finally is either the last expres
});
}
private void generateInstanceOfInstruction(@NotNull KtType jetType) {
private void generateInstanceOfInstruction(@NotNull KotlinType jetType) {
Type type = boxType(asmType(jetType));
putReifierMarkerIfTypeIsReifiedParameter(jetType, ReifiedTypeInliner.INSTANCEOF_MARKER_METHOD_NAME);
TypeIntrinsics.instanceOf(v, jetType, type);
}
@NotNull
private StackValue generateCheckCastInstruction(@NotNull KtType jetType, boolean safeAs) {
private StackValue generateCheckCastInstruction(@NotNull KotlinType jetType, boolean safeAs) {
Type type = boxType(asmType(jetType));
putReifierMarkerIfTypeIsReifiedParameter(jetType,
safeAs ? ReifiedTypeInliner.SAFE_CHECKCAST_MARKER_METHOD_NAME
@@ -3828,7 +3828,7 @@ The "returned" value of try expression with no finally is either the last expres
return StackValue.onStack(type);
}
public void putReifierMarkerIfTypeIsReifiedParameter(@NotNull KtType type, @NotNull String markerMethodName) {
public void putReifierMarkerIfTypeIsReifiedParameter(@NotNull KotlinType type, @NotNull String markerMethodName) {
TypeParameterDescriptor typeParameterDescriptor = TypeUtils.getTypeParameterDescriptorOrNull(type);
if (typeParameterDescriptor != null && typeParameterDescriptor.isReified()) {
if (typeParameterDescriptor.getContainingDeclaration() != context.getContextDescriptor()) {
@@ -3962,7 +3962,7 @@ The "returned" value of try expression with no finally is either the last expres
if (rangeExpression instanceof KtBinaryExpression) {
KtBinaryExpression binaryExpression = (KtBinaryExpression) rangeExpression;
if (binaryExpression.getOperationReference().getReferencedNameElementType() == KtTokens.RANGE) {
KtType jetType = bindingContext.getType(rangeExpression);
KotlinType jetType = bindingContext.getType(rangeExpression);
assert jetType != null;
DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor();
return DescriptorUtilsKt.getBuiltIns(descriptor).getIntegralRanges().contains(descriptor);
@@ -57,7 +57,7 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.*;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
import org.jetbrains.org.objectweb.asm.commons.Method;
@@ -887,7 +887,7 @@ public class FunctionCodegen {
iv.load(1, OBJECT_TYPE);
KtType jetType = descriptor.getValueParameters().get(0).getType();
KotlinType jetType = descriptor.getValueParameters().get(0).getType();
// TODO: reuse logic from ExpressionCodegen
if (jetType.isMarkedNullable()) {
@@ -66,7 +66,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver;
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
import org.jetbrains.kotlin.serialization.ProtoBuf;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker;
import org.jetbrains.org.objectweb.asm.*;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
@@ -91,7 +91,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
private static final String ENUM_VALUES_FIELD_NAME = "$VALUES";
private Type superClassAsmType;
@Nullable // null means java/lang/Object
private KtType superClassType;
private KotlinType superClassType;
private final Type classAsmType;
private final boolean isLocal;
@@ -316,7 +316,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
LinkedHashSet<String> superInterfaces = new LinkedHashSet<String>();
Set<String> kotlinMarkerInterfaces = new LinkedHashSet<String>();
for (KtType supertype : descriptor.getTypeConstructor().getSupertypes()) {
for (KotlinType supertype : descriptor.getTypeConstructor().getSupertypes()) {
if (isJvmInterface(supertype.getConstructor().getDeclarationDescriptor())) {
sw.writeInterface();
Type jvmInterfaceType = typeMapper.mapSupertype(supertype, sw);
@@ -352,7 +352,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
return;
}
for (KtType supertype : descriptor.getTypeConstructor().getSupertypes()) {
for (KotlinType supertype : descriptor.getTypeConstructor().getSupertypes()) {
ClassifierDescriptor superClass = supertype.getConstructor().getDeclarationDescriptor();
if (superClass != null && !isJvmInterface(superClass)) {
superClassAsmType = typeMapper.mapClass(superClass);
@@ -421,11 +421,11 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
continue;
}
KtType returnType = function.getReturnType();
KotlinType returnType = function.getReturnType();
assert returnType != null : function.toString();
KtType paramType = function.getValueParameters().get(0).getType();
KotlinType paramType = function.getValueParameters().get(0).getType();
if (KotlinBuiltIns.isArray(returnType) && KotlinBuiltIns.isArray(paramType)) {
KtType elementType = function.getTypeParameters().get(0).getDefaultType();
KotlinType elementType = function.getTypeParameters().get(0).getDefaultType();
if (KotlinTypeChecker.DEFAULT.equalTypes(elementType, DescriptorUtilsKt.getBuiltIns(descriptor).getArrayElementType(returnType))
&& KotlinTypeChecker.DEFAULT.equalTypes(elementType, DescriptorUtilsKt
.getBuiltIns(descriptor).getArrayElementType(paramType))) {
@@ -738,7 +738,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
iv.getfield(classAsmType.getInternalName(), CAPTURED_THIS_FIELD, type.getDescriptor());
}
KtType captureReceiver = closure.getCaptureReceiverType();
KotlinType captureReceiver = closure.getCaptureReceiverType();
if (captureReceiver != null) {
iv.load(0, classAsmType);
Type type = typeMapper.mapType(captureReceiver);
@@ -1150,7 +1150,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
result.addField((KtDelegatorByExpressionSpecifier) specifier, propertyDescriptor);
}
else {
KtType expressionType = expression != null ? bindingContext.getType(expression) : null;
KotlinType expressionType = expression != null ? bindingContext.getType(expression) : null;
Type asmType =
expressionType != null ? typeMapper.mapType(expressionType) : typeMapper.mapType(getSuperClass(specifier));
result.addField((KtDelegatorByExpressionSpecifier) specifier, asmType, "$delegate_" + n);
@@ -1610,7 +1610,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
DelegationFieldsInfo.Field field = delegationFieldsInfo.getInfo((KtDelegatorByExpressionSpecifier) specifier);
generateDelegateField(field);
KtExpression delegateExpression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression();
KtType delegateExpressionType = delegateExpression != null ? bindingContext.getType(delegateExpression) : null;
KotlinType delegateExpressionType = delegateExpression != null ? bindingContext.getType(delegateExpression) : null;
generateDelegates(getSuperClass(specifier), delegateExpressionType, field);
}
}
@@ -1623,7 +1623,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
fieldInfo.name, fieldInfo.type.getDescriptor(), /*TODO*/null, null);
}
protected void generateDelegates(ClassDescriptor toTrait, KtType delegateExpressionType, DelegationFieldsInfo.Field field) {
protected void generateDelegates(ClassDescriptor toTrait, KotlinType delegateExpressionType, DelegationFieldsInfo.Field field) {
for (Map.Entry<CallableMemberDescriptor, CallableDescriptor> entry : CodegenUtilKt.getDelegates(descriptor, toTrait, delegateExpressionType).entrySet()) {
CallableMemberDescriptor callableMemberDescriptor = entry.getKey();
CallableDescriptor delegateTo = entry.getValue();
@@ -43,7 +43,7 @@ import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.AnnotationVisitor;
import java.io.File;
@@ -64,7 +64,7 @@ public class JvmCodegenUtil {
return false;
}
public static boolean isJvmInterface(KtType type) {
public static boolean isJvmInterface(KotlinType type) {
return isJvmInterface(type.getConstructor().getDeclarationDescriptor());
}
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.resolve.TargetPlatformKt;
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform;
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils;
import java.util.*;
@@ -72,11 +72,11 @@ public class JvmRuntimeTypes {
}
@NotNull
public Collection<KtType> getSupertypesForClosure(@NotNull FunctionDescriptor descriptor) {
public Collection<KotlinType> getSupertypesForClosure(@NotNull FunctionDescriptor descriptor) {
ReceiverParameterDescriptor receiverParameter = descriptor.getExtensionReceiverParameter();
//noinspection ConstantConditions
KtType functionType = DescriptorUtilsKt.getBuiltIns(descriptor).getFunctionType(
KotlinType functionType = DescriptorUtilsKt.getBuiltIns(descriptor).getFunctionType(
Annotations.Companion.getEMPTY(),
receiverParameter == null ? null : receiverParameter.getType(),
ExpressionTypingUtils.getValueParametersTypes(descriptor.getValueParameters()),
@@ -87,15 +87,15 @@ public class JvmRuntimeTypes {
}
@NotNull
public Collection<KtType> getSupertypesForFunctionReference(@NotNull FunctionDescriptor descriptor) {
public Collection<KotlinType> getSupertypesForFunctionReference(@NotNull FunctionDescriptor descriptor) {
ReceiverParameterDescriptor extensionReceiver = descriptor.getExtensionReceiverParameter();
ReceiverParameterDescriptor dispatchReceiver = descriptor.getDispatchReceiverParameter();
KtType receiverType =
KotlinType receiverType =
extensionReceiver != null ? extensionReceiver.getType() : dispatchReceiver != null ? dispatchReceiver.getType() : null;
//noinspection ConstantConditions
KtType functionType = DescriptorUtilsKt.getBuiltIns(descriptor).getFunctionType(
KotlinType functionType = DescriptorUtilsKt.getBuiltIns(descriptor).getFunctionType(
Annotations.Companion.getEMPTY(),
receiverType,
ExpressionTypingUtils.getValueParametersTypes(descriptor.getValueParameters()),
@@ -106,7 +106,7 @@ public class JvmRuntimeTypes {
}
@NotNull
public KtType getSupertypeForPropertyReference(@NotNull PropertyDescriptor descriptor) {
public KotlinType getSupertypeForPropertyReference(@NotNull PropertyDescriptor descriptor) {
int arity = (descriptor.getExtensionReceiverParameter() != null ? 1 : 0) +
(descriptor.getDispatchReceiverParameter() != null ? 1 : 0);
return (descriptor.isVar() ? mutablePropertyReferences : propertyReferences).get(arity).getDefaultType();
@@ -51,7 +51,7 @@ import org.jetbrains.kotlin.resolve.source.KotlinSourceElementKt;
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
import org.jetbrains.kotlin.storage.NotNullLazyValue;
import org.jetbrains.kotlin.types.ErrorUtils;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Label;
import org.jetbrains.org.objectweb.asm.MethodVisitor;
import org.jetbrains.org.objectweb.asm.Type;
@@ -413,7 +413,7 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
if (initializerValue == null) return state.getClassBuilderMode() != ClassBuilderMode.LIGHT_CLASSES;
//TODO: OPTIMIZATION: don't initialize static final fields
KtType jetType = getPropertyOrDelegateType(property, propertyDescriptor);
KotlinType jetType = getPropertyOrDelegateType(property, propertyDescriptor);
Type type = typeMapper.mapType(jetType);
return !skipDefaultValue(propertyDescriptor, initializerValue.getValue(), type);
}
@@ -432,10 +432,10 @@ public abstract class MemberCodegen<T extends KtElement/* TODO: & JetDeclaration
}
@NotNull
private KtType getPropertyOrDelegateType(@NotNull KtProperty property, @NotNull PropertyDescriptor descriptor) {
private KotlinType getPropertyOrDelegateType(@NotNull KtProperty property, @NotNull PropertyDescriptor descriptor) {
KtExpression delegateExpression = property.getDelegateExpression();
if (delegateExpression != null) {
KtType delegateType = bindingContext.getType(delegateExpression);
KotlinType delegateType = bindingContext.getType(delegateExpression);
assert delegateType != null : "Type of delegate expression should be recorded";
return delegateType;
}
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.scopes.KtScope;
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.TypeConstructor;
import org.jetbrains.kotlin.types.TypeConstructorImpl;
import org.jetbrains.kotlin.types.TypeUtils;
@@ -41,7 +41,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase implements Class
private Visibility visibility;
private TypeConstructor typeConstructor;
private List<TypeParameterDescriptor> typeParameters;
private final Collection<KtType> supertypes = new ArrayList<KtType>();
private final Collection<KotlinType> supertypes = new ArrayList<KotlinType>();
public MutableClassDescriptor(
@NotNull DeclarationDescriptor containingDeclaration,
@@ -116,7 +116,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase implements Class
return typeConstructor;
}
public void addSupertype(@NotNull KtType supertype) {
public void addSupertype(@NotNull KotlinType supertype) {
assert !supertype.isError() : "Error types must be filtered out in DescriptorResolver";
if (TypeUtils.getClassDescriptor(supertype) != null) {
// See the Errors.SUPERTYPE_NOT_A_CLASS_OR_INTERFACE
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPropertyDescriptor;
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
import org.jetbrains.kotlin.types.ErrorUtils;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.FieldVisitor;
import org.jetbrains.org.objectweb.asm.MethodVisitor;
import org.jetbrains.org.objectweb.asm.Opcodes;
@@ -275,7 +275,7 @@ public class PropertyCodegen {
KtNamedDeclaration element,
PropertyDescriptor propertyDescriptor,
boolean isDelegate,
KtType jetType,
KotlinType jetType,
Object defaultValue,
Annotations annotations
) {
@@ -362,7 +362,7 @@ public class PropertyCodegen {
private void generatePropertyDelegateAccess(KtProperty p, PropertyDescriptor propertyDescriptor, Annotations annotations) {
KtExpression delegateExpression = p.getDelegateExpression();
KtType delegateType = delegateExpression != null ? bindingContext.getType(p.getDelegateExpression()) : null;
KotlinType delegateType = delegateExpression != null ? bindingContext.getType(p.getDelegateExpression()) : null;
if (delegateType == null) {
// If delegate expression is unresolved reference
delegateType = ErrorUtils.createErrorType("Delegate type");
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.name.FqNameUnsafe;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.psi.*;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import java.util.List;
@@ -53,11 +53,11 @@ public class RangeCodegenUtil {
private RangeCodegenUtil() {}
public static boolean isRange(KtType rangeType) {
public static boolean isRange(KotlinType rangeType) {
return !rangeType.isMarkedNullable() && getPrimitiveRangeElementType(rangeType) != null;
}
public static boolean isProgression(KtType rangeType) {
public static boolean isProgression(KotlinType rangeType) {
return !rangeType.isMarkedNullable() && getPrimitiveProgressionElementType(rangeType) != null;
}
@@ -92,18 +92,18 @@ public class RangeCodegenUtil {
}
@Nullable
private static PrimitiveType getPrimitiveRangeElementType(KtType rangeType) {
private static PrimitiveType getPrimitiveRangeElementType(KotlinType rangeType) {
return getPrimitiveRangeOrProgressionElementType(rangeType, RANGE_TO_ELEMENT_TYPE);
}
@Nullable
private static PrimitiveType getPrimitiveProgressionElementType(KtType rangeType) {
private static PrimitiveType getPrimitiveProgressionElementType(KotlinType rangeType) {
return getPrimitiveRangeOrProgressionElementType(rangeType, PROGRESSION_TO_ELEMENT_TYPE);
}
@Nullable
private static PrimitiveType getPrimitiveRangeOrProgressionElementType(
@NotNull KtType rangeOrProgression,
@NotNull KotlinType rangeOrProgression,
@NotNull ImmutableMap<FqName, PrimitiveType> map
) {
ClassifierDescriptor declarationDescriptor = rangeOrProgression.getConstructor().getDeclarationDescriptor();
@@ -21,22 +21,22 @@ import org.jetbrains.kotlin.descriptors.ClassifierDescriptor;
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor;
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor;
import org.jetbrains.kotlin.load.java.sam.SingleAbstractMethodUtils;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
public class SamType {
public static SamType create(@NotNull KtType originalType) {
public static SamType create(@NotNull KotlinType originalType) {
if (!SingleAbstractMethodUtils.isSamType(originalType)) return null;
return new SamType(originalType);
}
private final KtType type;
private final KotlinType type;
private SamType(@NotNull KtType type) {
private SamType(@NotNull KotlinType type) {
this.type = type;
}
@NotNull
public KtType getType() {
public KotlinType getType() {
return type;
}
@@ -48,7 +48,7 @@ public class SamType {
}
@NotNull
public KtType getKotlinFunctionType() {
public KotlinType getKotlinFunctionType() {
//noinspection ConstantConditions
return getJavaClassDescriptor().getFunctionTypeForSamInterface();
}
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.util.OperatorNameConventions;
import org.jetbrains.org.objectweb.asm.MethodVisitor;
import org.jetbrains.org.objectweb.asm.Type;
@@ -64,7 +64,7 @@ public class SamWrapperCodegen {
Type asmType = asmTypeByFqNameWithoutInnerClasses(fqName);
// e.g. (T, T) -> Int
KtType functionType = samType.getKotlinFunctionType();
KotlinType functionType = samType.getKotlinFunctionType();
ClassDescriptor classDescriptor = new ClassDescriptorImpl(
samType.getJavaClassDescriptor().getContainingDeclaration(),
@@ -140,7 +140,7 @@ public class SamWrapperCodegen {
Type functionType,
ClassBuilder cv,
SimpleFunctionDescriptor erasedInterfaceFunction,
KtType functionJetType
KotlinType functionJetType
) {
// using root context to avoid creating ClassDescriptor and everything else
FunctionCodegen codegen = new FunctionCodegen(state.getRootContext().intoClass(
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.codegen.context.EnclosedValueDescriptor;
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Type;
import java.util.List;
@@ -33,7 +33,7 @@ public interface CalculatedClosure {
ClassDescriptor getCaptureThis();
@Nullable
KtType getCaptureReceiverType();
KotlinType getCaptureReceiverType();
@NotNull
Map<DeclarationDescriptor, EnclosedValueDescriptor> getCaptureVariables();
@@ -51,7 +51,7 @@ import org.jetbrains.kotlin.resolve.constants.EnumValue;
import org.jetbrains.kotlin.resolve.constants.NullValue;
import org.jetbrains.kotlin.resolve.scopes.KtScope;
import org.jetbrains.kotlin.resolve.source.KotlinSourceElementKt;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Type;
import java.util.*;
@@ -90,7 +90,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
private ClassDescriptor recordClassForCallable(
@NotNull KtElement element,
@NotNull CallableDescriptor callableDescriptor,
@NotNull Collection<KtType> supertypes,
@NotNull Collection<KotlinType> supertypes,
@NotNull String name
) {
String simpleName = name.substring(name.lastIndexOf('/') + 1);
@@ -275,7 +275,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
if (functionDescriptor == null) return;
String name = inventAnonymousClassName();
Collection<KtType> supertypes = runtimeTypes.getSupertypesForClosure(functionDescriptor);
Collection<KotlinType> supertypes = runtimeTypes.getSupertypesForClosure(functionDescriptor);
ClassDescriptor classDescriptor = recordClassForCallable(functionLiteral, functionDescriptor, supertypes, name);
recordClosure(classDescriptor, name);
@@ -293,7 +293,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
CallableDescriptor target = referencedFunction.getResultingDescriptor();
CallableDescriptor callableDescriptor;
Collection<KtType> supertypes;
Collection<KotlinType> supertypes;
if (target instanceof FunctionDescriptor) {
callableDescriptor = bindingContext.get(FUNCTION, expression);
@@ -345,7 +345,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
if (delegate != null && descriptor instanceof PropertyDescriptor) {
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor;
String name = inventAnonymousClassName();
KtType supertype = runtimeTypes.getSupertypeForPropertyReference(propertyDescriptor);
KotlinType supertype = runtimeTypes.getSupertypeForPropertyReference(propertyDescriptor);
ClassDescriptor classDescriptor = recordClassForCallable(delegate, propertyDescriptor, Collections.singleton(supertype), name);
recordClosure(classDescriptor, name);
}
@@ -368,7 +368,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
}
else {
String name = inventAnonymousClassName();
Collection<KtType> supertypes = runtimeTypes.getSupertypesForClosure(functionDescriptor);
Collection<KotlinType> supertypes = runtimeTypes.getSupertypesForClosure(functionDescriptor);
ClassDescriptor classDescriptor = recordClassForCallable(function, functionDescriptor, supertypes, name);
recordClosure(classDescriptor, name);
@@ -530,7 +530,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
int fieldNumber = mappings.size();
assert expression.getSubjectExpression() != null : "subject expression should be not null in a valid when by enums";
KtType type = bindingContext.getType(expression.getSubjectExpression());
KotlinType type = bindingContext.getType(expression.getSubjectExpression());
assert type != null : "should not be null in a valid when by enums";
ClassDescriptor classDescriptor = (ClassDescriptor) type.getConstructor().getDeclarationDescriptor();
assert classDescriptor != null : "because it's enum";
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.codegen.context.EnclosedValueDescriptor;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Type;
import java.util.*;
@@ -71,7 +71,7 @@ public final class MutableClosure implements CalculatedClosure {
}
@Override
public KtType getCaptureReceiverType() {
public KotlinType getCaptureReceiverType() {
if (captureReceiver) {
ReceiverParameterDescriptor parameter = getEnclosingReceiverDescriptor();
assert parameter != null : "Receiver parameter should exist in " + enclosingFunWithReceiverDescriptor;
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
import org.jetbrains.kotlin.storage.NullableLazyValue;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Type;
import java.util.*;
@@ -282,7 +282,7 @@ public abstract class CodegenContext<T extends DeclarationDescriptor> {
public <D extends CallableMemberDescriptor> D getAccessor(
@NotNull D possiblySubstitutedDescriptor,
boolean isForBackingFieldInOuterClass,
@Nullable KtType delegateType,
@Nullable KotlinType delegateType,
@Nullable KtSuperExpression superCallExpression
) {
if (accessors == null) {
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.load.java.JvmAbi;
import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Type;
import static org.jetbrains.kotlin.codegen.AsmUtil.CAPTURED_RECEIVER_FIELD;
@@ -139,7 +139,7 @@ public interface LocalLookup {
return null;
}
KtType receiverType = closure.getEnclosingReceiverDescriptor().getType();
KotlinType receiverType = closure.getEnclosingReceiverDescriptor().getType();
Type type = state.getTypeMapper().mapType(receiverType);
StackValue.StackValueWithSimpleReceiver innerValue = StackValue.field(type, classType, CAPTURED_RECEIVER_FIELD, false,
StackValue.LOCAL_0, d);
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.codegen.context.MethodContext
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods
import org.jetbrains.kotlin.codegen.intrinsics.TypeIntrinsics
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.types.KtType
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.org.objectweb.asm.MethodVisitor
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
@@ -159,14 +159,14 @@ public class ReifiedTypeInliner(private val parametersMapping: ReifiedTypeParame
private fun processNewArray(insn: MethodInsnNode, parameter: Type) =
processNextTypeInsn(insn, parameter, Opcodes.ANEWARRAY)
private fun processCheckcast(insn: MethodInsnNode, instructions: InsnList, jetType: KtType, asmType: Type, safe: Boolean) =
private fun processCheckcast(insn: MethodInsnNode, instructions: InsnList, jetType: KotlinType, asmType: Type, safe: Boolean) =
rewriteNextTypeInsn(insn, Opcodes.CHECKCAST) { instanceofInsn: AbstractInsnNode ->
if (instanceofInsn !is TypeInsnNode) return false
TypeIntrinsics.checkcast(instanceofInsn, instructions, jetType, asmType, safe)
return true
}
private fun processInstanceof(insn: MethodInsnNode, instructions: InsnList, jetType: KtType, asmType: Type) =
private fun processInstanceof(insn: MethodInsnNode, instructions: InsnList, jetType: KotlinType, asmType: Type) =
rewriteNextTypeInsn(insn, Opcodes.INSTANCEOF) { instanceofInsn: AbstractInsnNode ->
if (instanceofInsn !is TypeInsnNode) return false
TypeIntrinsics.instanceOf(instanceofInsn, instructions, jetType, asmType)
@@ -213,7 +213,7 @@ public class ReifiedTypeInliner(private val parametersMapping: ReifiedTypeParame
public class ReifiedTypeParameterMappings() {
private val mappingsByName = hashMapOf<String, ReifiedTypeParameterMapping>()
public fun addParameterMappingToType(name: String, type: KtType, asmType: Type, signature: String) {
public fun addParameterMappingToType(name: String, type: KotlinType, asmType: Type, signature: String) {
mappingsByName[name] = ReifiedTypeParameterMapping(name, type, asmType, newName = null, signature = signature)
}
@@ -227,7 +227,7 @@ public class ReifiedTypeParameterMappings() {
}
public class ReifiedTypeParameterMapping(
val name: String, val type: KtType?, val asmType: Type?, val newName: String?, val signature: String?
val name: String, val type: KotlinType?, val asmType: Type?, val newName: String?, val signature: String?
)
public class ReifiedTypeParametersUsages {
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.psi.KtClassLiteralExpression
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
import org.jetbrains.kotlin.types.KtType
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
@@ -57,7 +57,7 @@ public class KClassJavaProperty : IntrinsicPropertyGetter() {
}
}
private fun isReifiedTypeParameter(type: KtType): Boolean {
private fun isReifiedTypeParameter(type: KotlinType): Boolean {
val typeDescriptor = type.constructor.declarationDescriptor
return typeDescriptor is TypeParameterDescriptor && typeDescriptor.isReified
}
@@ -17,7 +17,7 @@
package org.jetbrains.kotlin.codegen.intrinsics
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.types.KtType
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
@@ -26,7 +26,7 @@ import org.jetbrains.org.objectweb.asm.tree.*
import kotlin.text.Regex
public object TypeIntrinsics {
public @JvmStatic fun instanceOf(v: InstructionAdapter, jetType: KtType, boxedAsmType: Type) {
public @JvmStatic fun instanceOf(v: InstructionAdapter, jetType: KotlinType, boxedAsmType: Type) {
val functionTypeArity = getFunctionTypeArity(jetType)
if (functionTypeArity >= 0) {
v.iconst(functionTypeArity)
@@ -57,7 +57,7 @@ public object TypeIntrinsics {
LdcInsnNode(Integer(value))
}
public @JvmStatic fun instanceOf(instanceofInsn: TypeInsnNode, instructions: InsnList, jetType: KtType, asmType: Type) {
public @JvmStatic fun instanceOf(instanceofInsn: TypeInsnNode, instructions: InsnList, jetType: KotlinType, asmType: Type) {
val functionTypeArity = getFunctionTypeArity(jetType)
if (functionTypeArity >= 0) {
instructions.insertBefore(instanceofInsn, iconstNode(functionTypeArity))
@@ -78,7 +78,7 @@ public object TypeIntrinsics {
instanceofInsn.desc = asmType.internalName
}
public @JvmStatic fun checkcast(v: InstructionAdapter, jetType: KtType, asmType: Type, safe: Boolean) {
public @JvmStatic fun checkcast(v: InstructionAdapter, jetType: KotlinType, asmType: Type, safe: Boolean) {
if (safe) {
v.checkcast(asmType)
return
@@ -106,7 +106,7 @@ public object TypeIntrinsics {
v.checkcast(asmType)
}
public @JvmStatic fun checkcast(checkcastInsn: TypeInsnNode, instructions: InsnList, jetType: KtType, asmType: Type, safe: Boolean) {
public @JvmStatic fun checkcast(checkcastInsn: TypeInsnNode, instructions: InsnList, jetType: KotlinType, asmType: Type, safe: Boolean) {
if (safe) {
checkcastInsn.desc = asmType.internalName
return
@@ -159,7 +159,7 @@ public object TypeIntrinsics {
private val IS_MUTABLE_COLLECTION_METHOD_DESCRIPTOR =
Type.getMethodDescriptor(Type.BOOLEAN_TYPE, Type.getObjectType("java/lang/Object"))
private fun getClassFqName(jetType: KtType): String? {
private fun getClassFqName(jetType: KotlinType): String? {
val classDescriptor = TypeUtils.getClassDescriptor(jetType) ?: return null
return DescriptorUtils.getFqName(classDescriptor).asString()
}
@@ -169,7 +169,7 @@ public object TypeIntrinsics {
/**
* @return function type arity (non-negative), or -1 if the given type is not a function type
*/
private fun getFunctionTypeArity(jetType: KtType): Int {
private fun getFunctionTypeArity(jetType: KotlinType): Int {
val classFqName = getClassFqName(jetType) ?: return -1
val match = KOTLIN_FUNCTION_INTERFACE_REGEX.match(classFqName) ?: return -1
return Integer.valueOf(match.groups[1]!!.value)
@@ -182,7 +182,7 @@ public object TypeIntrinsics {
invokestatic(INTRINSICS_CLASS, methodName, methodDescriptor, false)
}
private fun getIsMutableCollectionMethodName(jetType: KtType): String? =
private fun getIsMutableCollectionMethodName(jetType: KotlinType): String? =
IS_MUTABLE_COLLECTION_METHOD_NAME[getClassFqName(jetType)]
private val CHECKCAST_METHOD_NAME = hashMapOf(
@@ -196,7 +196,7 @@ public object TypeIntrinsics {
"kotlin.MutableMap.MutableEntry" to "asMutableMapEntry"
)
private fun getAsMutableCollectionMethodName(jetType: KtType): String? {
private fun getAsMutableCollectionMethodName(jetType: KotlinType): String? {
val classDescriptor = TypeUtils.getClassDescriptor(jetType) ?: return null
val classFqName = DescriptorUtils.getFqName(classDescriptor).asString()
return CHECKCAST_METHOD_NAME[classFqName]
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.serialization.SerializerExtension;
import org.jetbrains.kotlin.serialization.StringTable;
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf;
import org.jetbrains.kotlin.serialization.jvm.JvmProtoBufUtil;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.Type;
import org.jetbrains.org.objectweb.asm.commons.Method;
@@ -70,7 +70,7 @@ public class JvmSerializerExtension extends SerializerExtension {
}
@Override
public void serializeType(@NotNull KtType type, @NotNull ProtoBuf.Type.Builder proto) {
public void serializeType(@NotNull KotlinType type, @NotNull ProtoBuf.Type.Builder proto) {
// TODO: don't store type annotations in our binary metadata on Java 8, use *TypeAnnotations attributes instead
for (AnnotationDescriptor annotation : type.getAnnotations()) {
proto.addExtension(JvmProtoBuf.typeAnnotation, annotationSerializer.serializeAnnotation(annotation));
@@ -200,7 +200,7 @@ public class JvmSerializerExtension extends SerializerExtension {
sb.append(")");
KtType returnType = descriptor.getReturnType();
KotlinType returnType = descriptor.getReturnType();
String returnTypeDesc = returnType == null ? "V" : mapTypeDefault(returnType);
if (returnTypeDesc == null) return true;
sb.append(returnTypeDesc);
@@ -213,7 +213,7 @@ public class JvmSerializerExtension extends SerializerExtension {
}
@Nullable
private String mapTypeDefault(@NotNull KtType type) {
private String mapTypeDefault(@NotNull KotlinType type) {
ClassifierDescriptor classifier = type.getConstructor().getDeclarationDescriptor();
if (!(classifier instanceof ClassDescriptor)) return null;
ClassId classId = classId((ClassDescriptor) classifier);
@@ -342,7 +342,7 @@ public class JetTypeMapper {
@NotNull
private Type mapReturnType(@NotNull CallableDescriptor descriptor, @Nullable BothSignatureWriter sw) {
KtType returnType = descriptor.getReturnType();
KotlinType returnType = descriptor.getReturnType();
assert returnType != null : "Function has no return type: " + descriptor;
if (descriptor instanceof ConstructorDescriptor) {
@@ -370,17 +370,17 @@ public class JetTypeMapper {
}
@NotNull
private Type mapType(@NotNull KtType jetType, @NotNull JetTypeMapperMode mode) {
private Type mapType(@NotNull KotlinType jetType, @NotNull JetTypeMapperMode mode) {
return mapType(jetType, null, mode);
}
@NotNull
public Type mapSupertype(@NotNull KtType jetType, @Nullable BothSignatureWriter signatureVisitor) {
public Type mapSupertype(@NotNull KotlinType jetType, @Nullable BothSignatureWriter signatureVisitor) {
return mapType(jetType, signatureVisitor, JetTypeMapperMode.SUPER_TYPE);
}
@NotNull
public Type mapTypeParameter(@NotNull KtType jetType, @Nullable BothSignatureWriter signatureVisitor) {
public Type mapTypeParameter(@NotNull KotlinType jetType, @Nullable BothSignatureWriter signatureVisitor) {
return mapType(jetType, signatureVisitor, JetTypeMapperMode.TYPE_PARAMETER);
}
@@ -390,7 +390,7 @@ public class JetTypeMapper {
}
@NotNull
public Type mapType(@NotNull KtType jetType) {
public Type mapType(@NotNull KotlinType jetType) {
return mapType(jetType, null, JetTypeMapperMode.VALUE);
}
@@ -415,13 +415,13 @@ public class JetTypeMapper {
}
@NotNull
private Type mapType(@NotNull KtType jetType, @Nullable BothSignatureWriter signatureVisitor, @NotNull JetTypeMapperMode mode) {
private Type mapType(@NotNull KotlinType jetType, @Nullable BothSignatureWriter signatureVisitor, @NotNull JetTypeMapperMode mode) {
return mapType(jetType, signatureVisitor, mode, Variance.INVARIANT);
}
@NotNull
private Type mapType(
@NotNull KtType jetType,
@NotNull KotlinType jetType,
@Nullable BothSignatureWriter signatureVisitor,
@NotNull JetTypeMapperMode kind,
@NotNull Variance howThisTypeIsUsed
@@ -450,7 +450,7 @@ public class JetTypeMapper {
TypeConstructor constructor = jetType.getConstructor();
DeclarationDescriptor descriptor = constructor.getDeclarationDescriptor();
if (constructor instanceof IntersectionTypeConstructor) {
jetType = CommonSupertypes.commonSupertype(new ArrayList<KtType>(constructor.getSupertypes()));
jetType = CommonSupertypes.commonSupertype(new ArrayList<KotlinType>(constructor.getSupertypes()));
}
if (descriptor == null) {
@@ -473,7 +473,7 @@ public class JetTypeMapper {
throw new UnsupportedOperationException("arrays must have one type argument");
}
TypeProjection memberProjection = jetType.getArguments().get(0);
KtType memberType = memberProjection.getType();
KotlinType memberType = memberProjection.getType();
Type arrayElementType;
if (memberProjection.getProjectionKind() == Variance.IN_VARIANCE) {
@@ -520,7 +520,7 @@ public class JetTypeMapper {
}
@Nullable
private static Type mapBuiltinType(@NotNull KtType type) {
private static Type mapBuiltinType(@NotNull KotlinType type) {
DeclarationDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
if (!(descriptor instanceof ClassDescriptor)) return null;
@@ -583,7 +583,7 @@ public class JetTypeMapper {
}
@NotNull
private static String generateErrorMessageForErrorType(@NotNull KtType type, @NotNull DeclarationDescriptor descriptor) {
private static String generateErrorMessageForErrorType(@NotNull KotlinType type, @NotNull DeclarationDescriptor descriptor) {
PsiElement declarationElement = DescriptorToSourceUtils.descriptorToDeclaration(descriptor);
if (declarationElement == null) {
@@ -616,7 +616,7 @@ public class JetTypeMapper {
private void writeGenericType(
BothSignatureWriter signatureVisitor,
Type asmType,
KtType jetType,
KotlinType jetType,
Variance howThisTypeIsUsed,
boolean projectionsAllowed
) {
@@ -653,7 +653,7 @@ public class JetTypeMapper {
}
}
private static boolean hasNothingInArguments(KtType jetType) {
private static boolean hasNothingInArguments(KotlinType jetType) {
boolean hasNothingInArguments = CollectionsKt.any(jetType.getArguments(), new Function1<TypeProjection, Boolean>() {
@Override
public Boolean invoke(TypeProjection projection) {
@@ -691,7 +691,7 @@ public class JetTypeMapper {
}
private Type mapKnownAsmType(
KtType jetType,
KotlinType jetType,
Type asmType,
@Nullable BothSignatureWriter signatureVisitor,
@NotNull Variance howThisTypeIsUsed
@@ -700,7 +700,7 @@ public class JetTypeMapper {
}
private Type mapKnownAsmType(
KtType jetType,
KotlinType jetType,
Type asmType,
@Nullable BothSignatureWriter signatureVisitor,
@NotNull Variance howThisTypeIsUsed,
@@ -1092,7 +1092,7 @@ public class JetTypeMapper {
}
@Nullable
public String mapFieldSignature(@NotNull KtType backingFieldType) {
public String mapFieldSignature(@NotNull KotlinType backingFieldType) {
BothSignatureWriter sw = new BothSignatureWriter(BothSignatureWriter.Mode.TYPE);
mapType(backingFieldType, sw, JetTypeMapperMode.VALUE);
return sw.makeJavaGenericSignature();
@@ -1143,7 +1143,7 @@ public class JetTypeMapper {
{
sw.writeClassBound();
for (KtType jetType : typeParameterDescriptor.getUpperBounds()) {
for (KotlinType jetType : typeParameterDescriptor.getUpperBounds()) {
if (jetType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor) {
if (!isJvmInterface(jetType)) {
mapType(jetType, sw, JetTypeMapperMode.TYPE_PARAMETER);
@@ -1159,7 +1159,7 @@ public class JetTypeMapper {
}
sw.writeClassBoundEnd();
for (KtType jetType : typeParameterDescriptor.getUpperBounds()) {
for (KotlinType jetType : typeParameterDescriptor.getUpperBounds()) {
ClassifierDescriptor classifier = jetType.getConstructor().getDeclarationDescriptor();
if (classifier instanceof ClassDescriptor) {
if (isJvmInterface(jetType)) {
@@ -1179,11 +1179,11 @@ public class JetTypeMapper {
}
}
private void writeParameter(@NotNull BothSignatureWriter sw, @NotNull KtType type) {
private void writeParameter(@NotNull BothSignatureWriter sw, @NotNull KotlinType type) {
writeParameter(sw, JvmMethodParameterKind.VALUE, type);
}
private void writeParameter(@NotNull BothSignatureWriter sw, @NotNull JvmMethodParameterKind kind, @NotNull KtType type) {
private void writeParameter(@NotNull BothSignatureWriter sw, @NotNull JvmMethodParameterKind kind, @NotNull KotlinType type) {
sw.writeParameterType(kind);
mapType(type, sw, JetTypeMapperMode.VALUE);
sw.writeParameterTypeEnd();
@@ -1203,7 +1203,7 @@ public class JetTypeMapper {
writeParameter(sw, JvmMethodParameterKind.OUTER, captureThis.getDefaultType());
}
KtType captureReceiverType = closure != null ? closure.getCaptureReceiverType() : null;
KotlinType captureReceiverType = closure != null ? closure.getCaptureReceiverType() : null;
if (captureReceiverType != null) {
writeParameter(sw, JvmMethodParameterKind.RECEIVER, captureReceiverType);
}
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.psi.KtWhenExpression;
import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.constants.ConstantValue;
import org.jetbrains.kotlin.resolve.constants.NullValue;
import org.jetbrains.kotlin.types.KtType;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.TypeUtils;
import org.jetbrains.org.objectweb.asm.Label;
import org.jetbrains.org.objectweb.asm.Type;
@@ -131,7 +131,7 @@ abstract public class SwitchCodegen {
protected void generateNullCheckIfNeeded() {
assert expression.getSubjectExpression() != null : "subject expression can't be null";
KtType subjectJetType = bindingContext.getType(expression.getSubjectExpression());
KotlinType subjectJetType = bindingContext.getType(expression.getSubjectExpression());
assert subjectJetType != null : "subject type can't be null (i.e. void)";