[FIR] Generate type arguments for variable assignments
This commit is contained in:
+1
-1
@@ -219,7 +219,7 @@ internal class CallAndReferenceGenerator(
|
|||||||
is IrVariableSymbol -> IrSetVariableImpl(startOffset, endOffset, type, symbol, assignedValue, origin)
|
is IrVariableSymbol -> IrSetVariableImpl(startOffset, endOffset, type, symbol, assignedValue, origin)
|
||||||
else -> generateErrorCallExpression(startOffset, endOffset, calleeReference)
|
else -> generateErrorCallExpression(startOffset, endOffset, calleeReference)
|
||||||
}
|
}
|
||||||
}.applyReceivers(variableAssignment)
|
}.applyTypeArguments(variableAssignment).applyReceivers(variableAssignment)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun convertToIrConstructorCall(annotationCall: FirAnnotationCall): IrExpression {
|
fun convertToIrConstructorCall(annotationCall: FirAnnotationCall): IrExpression {
|
||||||
|
|||||||
+4
-1
@@ -135,6 +135,7 @@ class FirCallCompletionResultsWriterTransformer(
|
|||||||
): CompositeTransformResult<FirStatement> {
|
): CompositeTransformResult<FirStatement> {
|
||||||
val calleeReference = variableAssignment.calleeReference as? FirNamedReferenceWithCandidate
|
val calleeReference = variableAssignment.calleeReference as? FirNamedReferenceWithCandidate
|
||||||
?: return variableAssignment.compose()
|
?: return variableAssignment.compose()
|
||||||
|
val typeArguments = computeTypeArguments(variableAssignment, calleeReference.candidate)
|
||||||
return variableAssignment.transformCalleeReference(
|
return variableAssignment.transformCalleeReference(
|
||||||
StoreCalleeReference,
|
StoreCalleeReference,
|
||||||
buildResolvedNamedReference {
|
buildResolvedNamedReference {
|
||||||
@@ -142,7 +143,9 @@ class FirCallCompletionResultsWriterTransformer(
|
|||||||
name = calleeReference.name
|
name = calleeReference.name
|
||||||
resolvedSymbol = calleeReference.candidateSymbol
|
resolvedSymbol = calleeReference.candidateSymbol
|
||||||
},
|
},
|
||||||
).compose()
|
).apply {
|
||||||
|
replaceTypeArguments(typeArguments)
|
||||||
|
}.compose()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun transformFunctionCall(functionCall: FirFunctionCall, data: ExpectedArgumentType?): CompositeTransformResult<FirStatement> {
|
override fun transformFunctionCall(functionCall: FirFunctionCall, data: ExpectedArgumentType?): CompositeTransformResult<FirStatement> {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ FILE fqName:<root> fileName:/integerCoercionToT.kt
|
|||||||
VALUE_PARAMETER name:cv index:1 type:<root>.CInt32VarX
|
VALUE_PARAMETER name:cv index:1 type:<root>.CInt32VarX
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'public final fun <set-value> <T_INT> (value: T_INT of <root>.<get-value>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
CALL 'public final fun <set-value> <T_INT> (value: T_INT of <root>.<get-value>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||||
<T_INT>: <none>
|
<T_INT>: kotlin.Int
|
||||||
$receiver: GET_VAR 'cv: <root>.CInt32VarX declared in <root>.foo' type=<root>.CInt32VarX origin=null
|
$receiver: GET_VAR 'cv: <root>.CInt32VarX declared in <root>.foo' type=<root>.CInt32VarX origin=null
|
||||||
value: CALL 'public final fun <get-value> (): kotlin.Int declared in <root>.IdType' type=kotlin.Int origin=GET_PROPERTY
|
value: CALL 'public final fun <get-value> (): kotlin.Int declared in <root>.IdType' type=kotlin.Int origin=GET_PROPERTY
|
||||||
$this: GET_VAR 'value: <root>.IdType declared in <root>.foo' type=<root>.IdType origin=null
|
$this: GET_VAR 'value: <root>.IdType declared in <root>.foo' type=<root>.IdType origin=null
|
||||||
|
|||||||
Reference in New Issue
Block a user