Forbid vararg flattening in place there array was expected
This commit is contained in:
committed by
TeamCityServer
parent
8b2706aaee
commit
ac858f760a
@@ -750,7 +750,10 @@ class IrInterpreter(private val irBuiltIns: IrBuiltIns, private val bodyMap: Map
|
|||||||
it.interpret().check { executionResult -> return executionResult }
|
it.interpret().check { executionResult -> return executionResult }
|
||||||
return@flatMap when (val result = stack.popReturnValue()) {
|
return@flatMap when (val result = stack.popReturnValue()) {
|
||||||
is Wrapper -> listOf(result.value)
|
is Wrapper -> listOf(result.value)
|
||||||
is Primitive<*> -> arrayToList(result.value)
|
is Primitive<*> -> when {
|
||||||
|
expression.varargElementType.isArray() -> listOf(result.value)
|
||||||
|
else -> arrayToList(result.value)
|
||||||
|
}
|
||||||
is Common -> when {
|
is Common -> when {
|
||||||
result.irClass.defaultType.isUnsignedArray() -> arrayToList((result.fields.single().state as Primitive<*>).value)
|
result.irClass.defaultType.isUnsignedArray() -> arrayToList((result.fields.single().state as Primitive<*>).value)
|
||||||
else -> listOf(result.asProxy(this, elementIrClass?.owner))
|
else -> listOf(result.asProxy(this, elementIrClass?.owner))
|
||||||
|
|||||||
Reference in New Issue
Block a user