Files
kotlin-fork/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditions.kt
T
Alexey Tsvetkov 87558873b5 Fix source element for JsSwitch generated from 'when'
Before this change we set JsSwitch source to subject's JsExpression.
We ignore these types of source elements during:
1. js ast serialization (see 'JsAstSerializer.extractLocation');
2. source map generation (see 'SourceMapBuilderConsumer.addMapping').

However we might add indent during source generation
(see 'JsToStringGenerationVisitor.pushSourceInfo').

That seemingly broken 'testEnumEntryRemoved' in
'IncrementalJsCompilerRunnerTestGenerated.ClassHierarchyAffected',
because deserialized ast during incremental build would not
have source element at all (JsExpression was ignored), but ast
during rebuild would have JsExpression source element.
2018-04-19 05:18:54 +03:00

21 lines
353 B
Kotlin
Vendored

fun box(x: Int) {
println(
when (
x
) {
1,
2,
3 ->
55
4,
5 ->
66
else ->
77
}
)
}
// LINES: 19 4 4 3 3 4 6 9 9 6 11 13 13 11 16 16 3 2