Minor. Add test with boolean parameter

This commit is contained in:
Ilmir Usmanov
2020-08-11 19:54:29 +02:00
parent bcbb050326
commit 31e4ddafd1
7 changed files with 241 additions and 2 deletions
@@ -471,11 +471,16 @@ class CoroutineCodegenForLambda private constructor(
val fieldStackValue = StackValue.field(fieldForParameter, generateThisOrOuter(context.thisDescriptor, false))
val originalType = typeMapper.mapType(parameter.type)
// If a parameter has reference type, it has prefix L$,
// however, when the type is primitive, its prefix is ${type.descriptor}$.
// In other words, it the type is Boolean, the prefix is Z$.
// This is different from spilled variables, where all int-like primitives have prefix I$.
// This is not a problem, since we do not clean spilled primitives up
// and we do not coerce Int to Boolean, which takes quite a bit of bytecode (see coerceInt).
val normalizedType = originalType.normalize()
fieldStackValue.put(normalizedType, v)
val newIndex = myFrameMap.enter(parameter, originalType)
// FIXME: Coerce int
StackValue.coerce(normalizedType, originalType, v)
v.store(newIndex, originalType)