JVM_IR: Support callable references to suspend functions

This commit is contained in:
Ilmir Usmanov
2019-10-10 18:16:19 +03:00
parent e736b782dd
commit b0a0399dd0
9 changed files with 66 additions and 20 deletions
@@ -169,12 +169,14 @@ fun IrDeclarationContainer.addFunction(
name: String,
returnType: IrType,
modality: Modality = Modality.FINAL,
isStatic: Boolean = false
isStatic: Boolean = false,
isSuspend: Boolean = false
): IrSimpleFunction =
addFunction {
this.name = Name.identifier(name)
this.returnType = returnType
this.modality = modality
this.isSuspend = isSuspend
}.apply {
if (!isStatic) {
dispatchReceiverParameter = parentAsClass.thisReceiver!!.copyTo(this)