[FIR] varargs: do not leak source of value parameter to the call site
when source for compiled fir elements is set, it leaks e.g. to diagnostics, which is then filtered see `TestsWithStdLib.Experimental.testImplicitUsages`
This commit is contained in:
+3
-2
@@ -44,8 +44,9 @@ internal fun remapArgumentsWithVararg(
|
||||
var indexAfterVarargs = argumentList.size
|
||||
val newArgumentMapping = linkedMapOf<FirExpression, FirValueParameter>()
|
||||
val varargArgument = buildVarargArgumentsExpression {
|
||||
this.varargElementType = varargParameterTypeRef.withReplacedConeType(varargElementType)
|
||||
this.typeRef = varargParameterTypeRef.withReplacedConeType(varargArrayType)
|
||||
//todo ideally we should use here a source from the use-site and not from the declaration-site
|
||||
this.varargElementType = varargParameterTypeRef.withReplacedConeType(varargElementType, KtFakeSourceElementKind.VarargArgument)
|
||||
this.typeRef = varargParameterTypeRef.withReplacedConeType(varargArrayType, KtFakeSourceElementKind.VarargArgument)
|
||||
for ((i, arg) in argumentList.withIndex()) {
|
||||
val valueParameter = argumentMapping.getValue(arg)
|
||||
// Collect arguments if `arg` is a vararg argument of interest or other vararg arguments.
|
||||
|
||||
Vendored
+1
-1
@@ -36,7 +36,7 @@ fun takeUInt(@ImplicitIntegerCoercion u: UInt) {}
|
||||
fun takeULong(@ImplicitIntegerCoercion u: ULong) {}
|
||||
|
||||
@ExperimentalUnsignedTypes
|
||||
fun takeUBytes(@ImplicitIntegerCoercion vararg u: <!OPT_IN_USAGE!>UByte<!>) {}
|
||||
fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte) {}
|
||||
|
||||
fun takeLong(@ImplicitIntegerCoercion l: Long) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user