KT element: KtWhenExpression
FIR element: FirWhenExpressionImpl
FIR source kind: KtRealSourceElementKind

FIR element rendered:
when ([ResolvedTo(BODY_RESOLVE)] lval <when-subject>: R|kotlin/Any| = R|<local>/x|) {
    ($subj$ is R|kotlin/String|) ->  {
        String(1)
    }
    else ->  {
        String(2)
    }
}

FIR FILE:
FILE: [ResolvedTo(IMPORTS)] whenExpressionScript.kts
    SCRIPT: [ResolvedTo(TYPES)] <script-whenExpressionScript.kts>
        [ResolvedTo(TYPES)] <script receiver parameter>: R|kotlin/script/templates/standard/ScriptTemplateWithArgs|
        [ResolvedTo(TYPES)] lval args: R|kotlin/Array<kotlin/String>|

        public final [ResolvedTo(BODY_RESOLVE)] [ScriptTopLevelDeclaration=true] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Any|): R|kotlin/String| {
            ^foo when ([ResolvedTo(BODY_RESOLVE)] lval <when-subject>: R|kotlin/Any| = R|<local>/x|) {
                ($subj$ is R|kotlin/String|) ->  {
                    String(1)
                }
                else ->  {
                    String(2)
                }
            }

        }