Skip to content

Commit

Permalink
Fix using IrFactory's deprecated api (#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshired committed Nov 3, 2023
1 parent ba28879 commit 01bd98f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Expand Up @@ -43,15 +43,16 @@ class NativeTransformer(messageCollector: MessageCollector, pluginContext: IrPlu
name = Name.identifier(EntryPoint.LauncherValName)
}.also { field ->
field.correspondingPropertySymbol = this@apply.symbol
field.initializer = pluginContext.irFactory.createExpressionBody(startOffset, endOffset) {
this.expression = DeclarationIrBuilder(pluginContext, field.symbol).irBlock {
field.initializer = pluginContext.irFactory.createExpressionBody(
startOffset,
endOffset,
DeclarationIrBuilder(pluginContext, field.symbol).irBlock {
+callLauncher(launchFn, specs, configs) {
irCall(withTeamCityListenerMethodNameFn).also { withTeamCity ->
withTeamCity.dispatchReceiver = irCall(launcherConstructor)
}
}
}
}
})
}

addGetter {
Expand Down
Expand Up @@ -4,6 +4,7 @@ import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.backend.common.lower.DeclarationIrBuilder
import org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.common.toLogger
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
Expand Down Expand Up @@ -82,8 +83,10 @@ class SpecIrGenerationExtension(private val messageCollector: MessageCollector)
name = Name.identifier(EntryPoint.LauncherValName)
}.also { field ->
field.correspondingPropertySymbol = this@apply.symbol
field.initializer = pluginContext.irFactory.createExpressionBody(startOffset, endOffset) {
this.expression = DeclarationIrBuilder(pluginContext, field.symbol).irBlock {
field.initializer = pluginContext.irFactory.createExpressionBody(
startOffset,
endOffset,
DeclarationIrBuilder(pluginContext, field.symbol).irBlock {
+irCall(launchFn).also { launch ->
launch.dispatchReceiver = irCall(withTeamCityListenerMethodNameFn).also { withTeamCity ->
withTeamCity.dispatchReceiver = irCall(withSpecsFn).also { withSpecs ->
Expand All @@ -99,7 +102,7 @@ class SpecIrGenerationExtension(private val messageCollector: MessageCollector)
}
}
}
}
)
}

addGetter {
Expand Down

0 comments on commit 01bd98f

Please sign in to comment.