[FIR2IR] Handle references to constructors separately
This commit is contained in:
+10
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrProperty
|
||||
import org.jetbrains.kotlin.ir.expressions.IrErrorCallExpression
|
||||
@@ -66,6 +67,15 @@ internal class CallAndReferenceGenerator(
|
||||
referencedProperty.setter?.symbol
|
||||
)
|
||||
}
|
||||
is IrConstructorSymbol -> {
|
||||
val constructor = symbol.owner
|
||||
val klass = constructor.parent as? IrClass
|
||||
IrFunctionReferenceImpl(
|
||||
startOffset, endOffset, type, symbol,
|
||||
typeArgumentsCount = constructor.typeParameters.size + (klass?.typeParameters?.size ?: 0),
|
||||
reflectionTarget = symbol
|
||||
)
|
||||
}
|
||||
is IrFunctionSymbol -> {
|
||||
IrFunctionReferenceImpl(
|
||||
startOffset, endOffset, type, symbol,
|
||||
|
||||
Reference in New Issue
Block a user