Do not preprocess apiVersionIsAtLeast calls inlined into kotlin package
If such call were to be inlined into an inline function in kotlin package, it would be expanded there preventing the further expansion in client code.
This commit is contained in:
@@ -355,7 +355,10 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
val caller = codegen.context.functionDescriptor
|
||||
if (!caller.isInline) return false
|
||||
val callerPackage = DescriptorUtils.getParentOfType(caller, PackageFragmentDescriptor::class.java) ?: return false
|
||||
return callerPackage.fqName.asString().startsWith("kotlin.")
|
||||
return callerPackage.fqName.asString().let {
|
||||
// package either equals to 'kotlin' or starts with 'kotlin.'
|
||||
it.startsWith("kotlin") && (it.length <= 6 || it[6] == '.')
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateClosuresBodies() {
|
||||
|
||||
Reference in New Issue
Block a user