FE: forbid extension calls on inline functional parameters
Extension receivers are currently implicitly noinline, and changing that would require modifying the syntax to allow marking them noinline or crossinline. ^KT-5837 Open ^KT-25787 Fixed ^KT-47965 Fixed ^KT-50107 Fixed ^KT-52403 Fixed
This commit is contained in:
@@ -238,12 +238,12 @@ internal class InlineChecker(private val descriptor: FunctionDescriptor) : CallC
|
||||
if (descriptor !is SimpleFunctionDescriptor) {
|
||||
return false
|
||||
}
|
||||
// TODO: receivers are currently not inline (KT-5837)
|
||||
// if (InlineUtil.isInline(descriptor)) return true
|
||||
|
||||
val containingDeclaration = descriptor.getContainingDeclaration()
|
||||
val isInvoke = descriptor.getName() == OperatorNameConventions.INVOKE &&
|
||||
return descriptor.getName() == OperatorNameConventions.INVOKE &&
|
||||
containingDeclaration is ClassDescriptor && containingDeclaration.defaultType.isBuiltinFunctionalType
|
||||
|
||||
return isInvoke || InlineUtil.isInline(descriptor)
|
||||
}
|
||||
|
||||
private fun checkVisibilityAndAccess(
|
||||
|
||||
Reference in New Issue
Block a user