Remove soft keyword coroutine & isCoroutine from ValueParameterDescriptor.

This commit is contained in:
Stanislav Erokhin
2016-12-15 06:14:21 +03:00
parent 55983a7808
commit 42440f50dc
42 changed files with 26 additions and 75 deletions
@@ -74,14 +74,14 @@ class CoroutineCodegen(
this@doResume, null, 0, Annotations.EMPTY, Name.identifier("data"),
module.builtIns.nullableAnyType,
/* isDefault = */ false, /* isCrossinline = */ false,
/* isNoinline = */ false, /* isCoroutine = */ false,
/* isNoinline = */ false,
/* varargElementType = */ null, SourceElement.NO_SOURCE
),
ValueParameterDescriptorImpl(
this@doResume, null, 1, Annotations.EMPTY, Name.identifier("throwable"),
module.builtIns.throwable.defaultType.makeNullable(),
/* isDefault = */ false, /* isCrossinline = */ false,
/* isNoinline = */ false, /* isCoroutine = */ false,
/* isNoinline = */ false,
/* varargElementType = */ null, SourceElement.NO_SOURCE
)
),
@@ -195,7 +195,7 @@ fun <D : FunctionDescriptor> createJvmSuspendFunctionView(function: D): D {
function, null, function.valueParameters.size, Annotations.EMPTY, Name.identifier("\$continuation"),
function.getContinuationParameterTypeOfSuspendFunction(),
/* declaresDefaultValue = */ false, /* isCrossinline = */ false,
/* isNoinline = */ false, /* isCoroutine = */ false, /* varargElementType = */ null, SourceElement.NO_SOURCE
/* isNoinline = */ false, /* varargElementType = */ null, SourceElement.NO_SOURCE
)
return function.createCustomCopy {
@@ -181,7 +181,6 @@ public class SingleAbstractMethodUtils {
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null, SourceElement.NO_SOURCE);
KotlinType returnType = typeParameters.substitutor.substitute(unsubstitutedSamType, Variance.OUT_VARIANCE);
@@ -309,7 +308,6 @@ public class SingleAbstractMethodUtils {
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null, SourceElement.NO_SOURCE
);
valueParameters.add(newParam);
@@ -34,7 +34,6 @@ import org.jetbrains.kotlin.name.FqNameUnsafe;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.KotlinToJvmSignatureMapper;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.KotlinToJvmSignatureMapperKt;
import org.jetbrains.kotlin.types.KotlinType;
@@ -175,7 +174,6 @@ public class SignaturesPropagationData {
originalParam.declaresDefaultValue(),
originalParam.isCrossinline(),
originalParam.isNoinline(),
originalParam.isCoroutine(),
varargCheckResult.isVararg ? DescriptorUtilsKt.getBuiltIns(originalParam).getArrayElementType(altType) : null,
SourceElement.NO_SOURCE
));
@@ -44,7 +44,7 @@ sealed class LocalVariableAccessorDescriptor(
private fun createValueParameter(name: Name, type: KotlinType): ValueParameterDescriptorImpl {
return ValueParameterDescriptorImpl(this, null, 0, Annotations.EMPTY, name, type,
false, false, false, false, null, SourceElement.NO_SOURCE)
false, false, false, null, SourceElement.NO_SOURCE)
}
}
@@ -186,7 +186,6 @@ public interface KtTokens {
KtModifierKeywordToken CONST_KEYWORD = KtModifierKeywordToken.softKeywordModifier("const");
KtModifierKeywordToken COROUTINE_KEYWORD = KtModifierKeywordToken.softKeywordModifier("coroutine");
KtModifierKeywordToken SUSPEND_KEYWORD = KtModifierKeywordToken.softKeywordModifier("suspend");
KtModifierKeywordToken HEADER_KEYWORD = KtModifierKeywordToken.softKeywordModifier("header");
@@ -212,7 +211,7 @@ public interface KtTokens {
LATEINIT_KEYWORD,
DATA_KEYWORD, INLINE_KEYWORD, NOINLINE_KEYWORD, TAILREC_KEYWORD, EXTERNAL_KEYWORD,
ANNOTATION_KEYWORD, CROSSINLINE_KEYWORD, CONST_KEYWORD, OPERATOR_KEYWORD, INFIX_KEYWORD,
COROUTINE_KEYWORD, SUSPEND_KEYWORD, HEADER_KEYWORD, IMPL_KEYWORD
SUSPEND_KEYWORD, HEADER_KEYWORD, IMPL_KEYWORD
);
/*
@@ -226,7 +225,7 @@ public interface KtTokens {
PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, OUT_KEYWORD, IN_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD,
REIFIED_KEYWORD, COMPANION_KEYWORD, SEALED_KEYWORD, LATEINIT_KEYWORD,
DATA_KEYWORD, INLINE_KEYWORD, NOINLINE_KEYWORD, TAILREC_KEYWORD, EXTERNAL_KEYWORD, ANNOTATION_KEYWORD, CROSSINLINE_KEYWORD,
CONST_KEYWORD, OPERATOR_KEYWORD, INFIX_KEYWORD, COROUTINE_KEYWORD, SUSPEND_KEYWORD, HEADER_KEYWORD, IMPL_KEYWORD
CONST_KEYWORD, OPERATOR_KEYWORD, INFIX_KEYWORD, SUSPEND_KEYWORD, HEADER_KEYWORD, IMPL_KEYWORD
};
TokenSet MODIFIER_KEYWORDS = TokenSet.create(MODIFIER_KEYWORDS_ARRAY);
@@ -137,7 +137,7 @@ object DataClassDescriptorResolver {
val declaresDefaultValue = propertyDescriptor != null
val parameterDescriptor = ValueParameterDescriptorImpl(
functionDescriptor, null, parameter.index, parameter.annotations, parameter.name, parameter.type, declaresDefaultValue,
parameter.isCrossinline, parameter.isNoinline, parameter.isCoroutine, parameter.varargElementType, parameter.source
parameter.isCrossinline, parameter.isNoinline, parameter.varargElementType, parameter.source
)
parameterDescriptors.add(parameterDescriptor)
if (declaresDefaultValue) {
@@ -378,7 +378,6 @@ public class DescriptorResolver {
valueParameter.hasDefaultValue(),
valueParameter.hasModifier(CROSSINLINE_KEYWORD),
valueParameter.hasModifier(NOINLINE_KEYWORD),
valueParameter.hasModifier(COROUTINE_KEYWORD),
varargElementType,
KotlinSourceElementKt.toSourceElement(valueParameter),
destructuringVariables
@@ -209,7 +209,6 @@ class FunctionDescriptorResolver(
val it = ValueParameterDescriptorImpl(functionDescriptor, null, 0, Annotations.EMPTY, Name.identifier("it"),
expectedParameterTypes!!.single(), valueParameterDescriptor.declaresDefaultValue(),
valueParameterDescriptor.isCrossinline, valueParameterDescriptor.isNoinline,
valueParameterDescriptor.isCoroutine,
valueParameterDescriptor.varargElementType, SourceElement.NO_SOURCE)
trace.record(BindingContext.AUTO_CREATED_IT, it)
return listOf(it)
@@ -81,7 +81,6 @@ object ModifierCheckerCore {
DATA_KEYWORD to EnumSet.of(CLASS_ONLY, INNER_CLASS, LOCAL_CLASS),
INLINE_KEYWORD to EnumSet.of(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER),
NOINLINE_KEYWORD to EnumSet.of(VALUE_PARAMETER),
COROUTINE_KEYWORD to EnumSet.of(VALUE_PARAMETER),
TAILREC_KEYWORD to EnumSet.of(FUNCTION),
SUSPEND_KEYWORD to EnumSet.of(FUNCTION),
EXTERNAL_KEYWORD to EnumSet.of(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, CLASS),
@@ -95,7 +94,6 @@ object ModifierCheckerCore {
)
val featureDependencies = mapOf(
COROUTINE_KEYWORD to LanguageFeature.Coroutines,
SUSPEND_KEYWORD to LanguageFeature.Coroutines,
INLINE_KEYWORD to LanguageFeature.InlineProperties,
HEADER_KEYWORD to LanguageFeature.MultiPlatformProjects,
@@ -171,7 +171,6 @@ class DynamicCallableDescriptors(storageManager: StorageManager, builtIns: Kotli
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
varargElementType,
SourceElement.NO_SOURCE
))
@@ -252,7 +252,7 @@ class HeaderImplDeclarationChecker(val moduleToCheck: ModuleDescriptor? = null)
areCompatibleTypeParameters(aTypeParams, bTypeParams, substitutor).let { if (it != Compatible) return it }
if (!equalsBy(aParams, bParams, ValueParameterDescriptor::declaresDefaultValue)) return Incompatible.ValueParameterHasDefault
if (!equalsBy(aParams, bParams, { p -> listOf(p.varargElementType != null, p.isCoroutine, p.isCrossinline, p.isNoinline) })) return Incompatible.ValueParameterModifiers
if (!equalsBy(aParams, bParams, { p -> listOf(p.varargElementType != null, p.isCrossinline, p.isNoinline) })) return Incompatible.ValueParameterModifiers
when {
a is FunctionDescriptor && b is FunctionDescriptor -> areCompatibleFunctions(a, b).let { if (it != Compatible) return it }
@@ -55,7 +55,6 @@ class LazyScriptClassMemberScope(
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null, SourceElement.NO_SOURCE
)
}
@@ -162,7 +162,6 @@ public class ControlStructureTypingUtils {
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null, SourceElement.NO_SOURCE
);
valueParameters.add(valueParameter);
@@ -44,5 +44,5 @@ fun CallableMemberDescriptor.createValueParameter(index: Int, name: String, type
Annotations.EMPTY,
Name.identifier(name),
type,
false, false, false, false, null, SourceElement.NO_SOURCE
false, false, false, null, SourceElement.NO_SOURCE
)
@@ -110,12 +110,12 @@ class InterfaceLowering(val state: GenerationState) : IrElementTransformerVoid()
val dispatchReceiver =
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
newFunction, null, 0, AnnotationsImpl(emptyList()), Name.identifier("this"),
interfaceDescriptor.defaultType, false, false, false, false, null, interfaceDescriptor.source, null)
interfaceDescriptor.defaultType, false, false, false, null, interfaceDescriptor.source, null)
val oldExtensionReceiver = descriptor.extensionReceiverParameter
val extensionReceiver = if (oldExtensionReceiver != null )
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
newFunction, null, 1, AnnotationsImpl(emptyList()), Name.identifier("receiver"),
oldExtensionReceiver.value.type, false, false, false, false, null, oldExtensionReceiver.source, null)
oldExtensionReceiver.value.type, false, false, false, null, oldExtensionReceiver.source, null)
else null
val valueParameters = listOf(dispatchReceiver, extensionReceiver).filterNotNull() +
@@ -314,7 +314,7 @@ class LocalFunctionsLowering(val context: JvmBackendContext): ClassLoweringPass
valueDescriptor.annotations,
suggestNameForCapturedValueParameter(valueDescriptor),
valueDescriptor.type,
false, false, false, false, null, valueDescriptor.source
false, false, false, null, valueDescriptor.source
)
private fun createUnsubstitutedParameter(
@@ -38,14 +38,14 @@ fun FunctionDescriptor.toStatic(
offset++
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
newFunction, null, 0, AnnotationsImpl(emptyList()), Name.identifier("this"),
dispatchReceiverClass!!.defaultType, false, false, false, false, null, dispatchReceiverClass.source, null)
dispatchReceiverClass!!.defaultType, false, false, false, null, dispatchReceiverClass.source, null)
}
val extensionReceiver = extensionReceiverParameter?.let {
offset++
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
newFunction, null, 1, AnnotationsImpl(emptyList()), Name.identifier("receiver"),
it.value.type, false, false, false, false, null, it.source, null)
it.value.type, false, false, false, null, it.source, null)
}
val valueParameters = listOf(dispatchReceiver, extensionReceiver).filterNotNull() +
@@ -75,7 +75,7 @@ class IrBuiltIns(val builtIns: KotlinBuiltIns) {
val valueParameterName = ValueParameterDescriptorImpl(
this, null, 0, Annotations.EMPTY, Name.identifier("name"), builtIns.stringType,
false, false, false, false, null, org.jetbrains.kotlin.descriptors.SourceElement.NO_SOURCE
false, false, false, null, org.jetbrains.kotlin.descriptors.SourceElement.NO_SOURCE
)
val returnType = KotlinTypeFactory.simpleType(Annotations.EMPTY, typeParameterT.typeConstructor, listOf(), false)
@@ -98,7 +98,6 @@ class IrBuiltinValueParameterDescriptorImpl(
override fun declaresDefaultValue(): Boolean = false
override fun getOriginal(): ValueParameterDescriptor = this
override fun getOverriddenDescriptors(): Collection<ValueParameterDescriptor> = emptyList()
override val isCoroutine: Boolean get() = false
override val isCrossinline: Boolean get() = false
override val isNoinline: Boolean get() = false
override val varargElementType: KotlinType? get() = null
@@ -76,7 +76,7 @@ private fun createSynthesizedFunctionWithFirstParameterAsReceiver(descriptor: Fu
original.valueParameters.drop(1).map { p ->
ValueParameterDescriptorImpl(
result, null, p.index - 1, p.annotations, Name.identifier("p${p.index + 1}"), p.type,
p.declaresDefaultValue(), p.isCrossinline, p.isNoinline, p.isCoroutine, p.varargElementType, p.source
p.declaresDefaultValue(), p.isCrossinline, p.isNoinline, p.varargElementType, p.source
)
},
original.returnType,
@@ -37,7 +37,6 @@ fun createValueParametersForInvokeInFunctionType(
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null, SourceElement.NO_SOURCE
)
}
@@ -330,7 +330,7 @@ class DescriptorSerializer private constructor(
val flags = Flags.getValueParameterFlags(
hasAnnotations(descriptor), descriptor.declaresDefaultValue(),
descriptor.isCrossinline, descriptor.isNoinline, descriptor.isCoroutine
descriptor.isCrossinline, descriptor.isNoinline
)
if (flags != builder.flags) {
builder.flags = flags
-1
View File
@@ -17,7 +17,6 @@ internal
in
out
suspend
coroutine
class Bar<abstract, abstract enum : T, out open,
public protected private internal abstract
open
-2
View File
@@ -57,8 +57,6 @@ JetFile: SoftKeywords.kt
PsiElement(out)('out')
PsiWhiteSpace('\n')
PsiElement(suspend)('suspend')
PsiWhiteSpace('\n')
PsiElement(coroutine)('coroutine')
PsiWhiteSpace('\n ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -77,10 +77,4 @@ public interface KParameter : KAnnotatedElement {
*/
@SinceKotlin("1.1")
public val isVararg: Boolean
/**
* `true` if this parameter is `coroutine`.
*/
@SinceKotlin("1.1")
public val isCoroutine: Boolean
}
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.load.kotlin.JvmPackagePartSource
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedMemberDescriptor
import org.jetbrains.kotlin.types.KotlinType
@@ -51,7 +50,6 @@ fun copyValueParameters(
oldParameter.declaresDefaultValue(),
oldParameter.isCrossinline,
oldParameter.isNoinline,
oldParameter.isCoroutine,
if (oldParameter.varargElementType != null) newOwner.module.builtIns.getArrayElementType(newType) else null,
oldParameter.source
)
@@ -608,7 +608,6 @@ class LazyJavaClassMemberScope(
method.hasAnnotationParameterDefaultValue,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
// Nulls are not allowed in annotation arguments in Java
varargElementType?.let { TypeUtils.makeNotNullable(it) },
c.components.sourceElementFactory.source(method)
@@ -207,7 +207,6 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
varargElementType,
c.components.sourceElementFactory.source(javaParameter)
)
@@ -136,7 +136,6 @@ class FunctionInvokeDescriptor private constructor(
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
/* varargElementType = */ null,
SourceElement.NO_SOURCE
)
@@ -54,6 +54,4 @@ interface ValueParameterDescriptor : VariableDescriptor, ParameterDescriptor {
val isCrossinline: Boolean
val isNoinline: Boolean
val isCoroutine: Boolean
}
@@ -786,7 +786,6 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
unsubstitutedValueParameter.declaresDefaultValue(),
unsubstitutedValueParameter.isCrossinline(),
unsubstitutedValueParameter.isNoinline(),
unsubstitutedValueParameter.isCoroutine(),
substituteVarargElementType,
SourceElement.NO_SOURCE
)
@@ -71,7 +71,6 @@ public class PropertySetterDescriptorImpl extends PropertyAccessorDescriptorImpl
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null, SourceElement.NO_SOURCE
);
}
@@ -32,7 +32,6 @@ open class ValueParameterDescriptorImpl(
private val declaresDefaultValue: Boolean,
override val isCrossinline: Boolean,
override val isNoinline: Boolean,
override val isCoroutine: Boolean,
override val varargElementType: KotlinType?,
source: SourceElement
) : VariableDescriptorImpl(containingDeclaration, annotations, name, outType, source), ValueParameterDescriptor {
@@ -51,16 +50,15 @@ open class ValueParameterDescriptorImpl(
outType: KotlinType,
declaresDefaultValue: Boolean,
isCrossinline: Boolean,
isNoinline: Boolean, isCoroutine: Boolean, varargElementType: KotlinType?,
source: SourceElement,
isNoinline: Boolean, varargElementType: KotlinType?, source: SourceElement,
destructuringVariables: (() -> List<VariableDescriptor>)?
): ValueParameterDescriptorImpl =
if (destructuringVariables == null)
ValueParameterDescriptorImpl(containingDeclaration, original, index, annotations, name, outType,
declaresDefaultValue, isCrossinline, isNoinline, isCoroutine, varargElementType, source)
declaresDefaultValue, isCrossinline, isNoinline, varargElementType, source)
else
WithDestructuringDeclaration(containingDeclaration, original, index, annotations, name, outType,
declaresDefaultValue, isCrossinline, isNoinline, isCoroutine, varargElementType, source,
declaresDefaultValue, isCrossinline, isNoinline, varargElementType, source,
destructuringVariables)
}
@@ -72,12 +70,12 @@ open class ValueParameterDescriptorImpl(
outType: KotlinType,
declaresDefaultValue: Boolean,
isCrossinline: Boolean,
isNoinline: Boolean, isCoroutine: Boolean, varargElementType: KotlinType?,
isNoinline: Boolean, varargElementType: KotlinType?,
source: SourceElement,
destructuringVariables: () -> List<VariableDescriptor>
) : ValueParameterDescriptorImpl(
containingDeclaration, original, index, annotations, name, outType, declaresDefaultValue,
isCrossinline, isNoinline, isCoroutine,
isCrossinline, isNoinline,
varargElementType, source) {
// It's forced to be lazy because its resolution depends on receiver of relevant lambda, that is being created at the same moment
// as value parameters.
@@ -110,7 +108,7 @@ open class ValueParameterDescriptorImpl(
override fun copy(newOwner: CallableDescriptor, newName: Name, newIndex: Int): ValueParameterDescriptor {
return ValueParameterDescriptorImpl(
newOwner, null, newIndex, annotations, newName, type, declaresDefaultValue(),
isCrossinline, isNoinline, isCoroutine, varargElementType, SourceElement.NO_SOURCE
isCrossinline, isNoinline, varargElementType, SourceElement.NO_SOURCE
)
}
@@ -798,10 +798,6 @@ internal class DescriptorRendererImpl(
builder.append("noinline ")
}
if (valueParameter.isCoroutine) {
builder.append("coroutine ")
}
renderVariable(valueParameter, includeName, builder, topLevel)
val withDefaultValue = renderDefaultValues && (if (debugMode) valueParameter.declaresDefaultValue() else valueParameter.hasDefaultValue())
@@ -144,7 +144,6 @@ public class DescriptorFactory {
/* declaresDefaultValue = */ false,
/* isCrossinline = */ false,
/* isNoinline = */ false,
/* isCoroutine = */ false,
null,
enumClass.getSource()
);
@@ -69,7 +69,6 @@ public class Flags {
public static final BooleanFlagField DECLARES_DEFAULT_VALUE = FlagField.booleanAfter(HAS_ANNOTATIONS);
public static final BooleanFlagField IS_CROSSINLINE = FlagField.booleanAfter(DECLARES_DEFAULT_VALUE);
public static final BooleanFlagField IS_NOINLINE = FlagField.booleanAfter(IS_CROSSINLINE);
public static final BooleanFlagField IS_COROUTINE = FlagField.booleanAfter(IS_NOINLINE);
// Accessors
@@ -256,14 +255,12 @@ public class Flags {
boolean hasAnnotations,
boolean declaresDefaultValue,
boolean isCrossinline,
boolean isNoinline,
boolean isCoroutine
boolean isNoinline
) {
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
| DECLARES_DEFAULT_VALUE.toFlags(declaresDefaultValue)
| IS_CROSSINLINE.toFlags(isCrossinline)
| IS_NOINLINE.toFlags(isNoinline)
| IS_COROUTINE.toFlags(isCoroutine)
;
}
@@ -263,7 +263,6 @@ class MemberDeserializer(private val c: DeserializationContext) {
Flags.DECLARES_DEFAULT_VALUE.get(flags),
Flags.IS_CROSSINLINE.get(flags),
Flags.IS_NOINLINE.get(flags),
Flags.IS_COROUTINE.get(flags),
proto.varargElementType(c.typeTable)?.let { c.typeDeserializer.type(it) },
SourceElement.NO_SOURCE
)
@@ -48,9 +48,6 @@ internal class KParameterImpl(
override val isVararg: Boolean
get() = descriptor.let { it is ValueParameterDescriptor && it.varargElementType != null }
override val isCoroutine: Boolean
get() = descriptor.let { it is ValueParameterDescriptor && it.isCoroutine }
override fun equals(other: Any?) =
other is KParameterImpl && callable == other.callable && descriptor == other.descriptor
@@ -205,9 +205,6 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
if (varargElementType != null) { modifiers.add(KtTokens.VARARG_KEYWORD) }
if (Flags.IS_CROSSINLINE.get(valueParameterProto.flags)) { modifiers.add(KtTokens.CROSSINLINE_KEYWORD) }
if (Flags.IS_NOINLINE.get(valueParameterProto.flags)) { modifiers.add(KtTokens.NOINLINE_KEYWORD) }
if (Flags.IS_COROUTINE.get(valueParameterProto.flags)) {
modifiers.add(KtTokens.COROUTINE_KEYWORD)
}
val modifierList = createModifierListStub(parameterStub, modifiers)
val parameterAnnotations = c.components.annotationLoader.loadValueParameterAnnotations(
@@ -206,7 +206,7 @@ class ChangeMemberFunctionSignatureFix private constructor(
ValueParameterDescriptorImpl(
descriptor, null, index,
parameter.annotations, parameter.name, parameter.returnType!!, parameter.declaresDefaultValue(),
parameter.isCrossinline, parameter.isNoinline, parameter.isCoroutine, parameter.varargElementType, SourceElement.NO_SOURCE
parameter.isCrossinline, parameter.isNoinline, parameter.varargElementType, SourceElement.NO_SOURCE
)
}
@@ -206,7 +206,7 @@ class CallArgumentTranslator private constructor(
val parenthesizedArgumentExpression = valueArguments[0].getArgumentExpression()!!
val argumentExpression = KtPsiUtil.deparenthesize(parenthesizedArgumentExpression)
result += if (parameterDescriptor.isCoroutine && argumentExpression is KtLambdaExpression) {
result += if (/*parameterDescriptor.isCoroutine=*/false && argumentExpression is KtLambdaExpression) {
val continuationType = parameterDescriptor.type.arguments.last().type
val continuationDescriptor = continuationType.constructor.declarationDescriptor as ClassDescriptor
val controllerType = parameterDescriptor.type.arguments[0].type