Expect/actual support in klibs under -Xklib-mpp
This commit is contained in:
committed by
alexander-gorshenev
parent
218d7c31ed
commit
dc8240c24e
+13
-5
@@ -5,12 +5,20 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.ir
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrProperty
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
|
||||
val IrDeclaration.isExpect
|
||||
get() = this is IrClass && isExpect ||
|
||||
this is IrFunction && isExpect ||
|
||||
this is IrProperty && isExpect
|
||||
this is IrProperty && isExpect
|
||||
|
||||
// The original isExpect represents what user has written.
|
||||
// This predicate means "there can possibly exist an 'actual' for the given declaration".
|
||||
// Shouldn't it be incorporated to descriptor -> ir declaration psi2ir translation phase?
|
||||
val IrDeclaration.isProperExpect
|
||||
get() = this is IrClass && isExpect ||
|
||||
this is IrFunction && isExpect ||
|
||||
this is IrProperty && isExpect ||
|
||||
(this is IrClass || this is IrFunction || this is IrProperty || this is IrConstructor || this is IrEnumEntry)
|
||||
&& (this.parent as? IrDeclaration)?.isExpect ?: false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user