Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
IVIanuu committed Jul 1, 2024
1 parent 3d27d99 commit e4f201e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:OptIn(InternalDiagnosticFactoryMethod::class)

package com.ivianuu.injekt.compiler.fir

import com.ivianuu.injekt.compiler.resolution.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class InjectCallTransformer(
private val irCtx: IrPluginContext,
private val ctx: InjektContext
) : IrElementTransformerVoidWithContext() {
private inner class RootContext(
val result: InjectionResult.Success,
val startOffset: Int
) {
private inner class RootContext(val result: InjectionResult.Success, val startOffset: Int) {
val statements = mutableListOf<IrStatement>()

val highestScope = mutableMapOf<ResolutionResult.Success.Value, InjectablesScope>()
Expand Down Expand Up @@ -388,11 +385,14 @@ class InjectCallTransformer(
result: ResolutionResult.Success.Value,
injectable: CallableInjectable
): IrExpression = when {
injectable.callable.type.unwrapTags().classifier.isObject -> objectExpression(injectable.callable.type.unwrapTags())
injectable.callable.type.unwrapTags().classifier.isObject ->
objectExpression(injectable.callable.type.unwrapTags())
else -> when {
injectable.callable.symbol is FirPropertySymbol &&
injectable.callable.symbol.isLocal -> localVariableExpression(injectable, injectable.callable.symbol)
injectable.callable.symbol is FirValueParameterSymbol -> parameterExpression(injectable, injectable.callable.symbol)
injectable.callable.symbol.isLocal ->
localVariableExpression(injectable, injectable.callable.symbol)
injectable.callable.symbol is FirValueParameterSymbol ->
parameterExpression(injectable, injectable.callable.symbol)
else -> functionExpression(result, injectable, injectable.callable.symbol)
}
}
Expand Down

0 comments on commit e4f201e

Please sign in to comment.