FILE: local.kt
    package foo

    public sealed class Sealed : R|kotlin/Any| {
        protected constructor(): R|foo/Sealed| {
            super<R|kotlin/Any|>()
        }

        public final data object A : R|foo/Sealed| {
            private constructor(): R|foo/Sealed.A| {
                super<R|foo/Sealed|>()
            }

        }

        public final data class B : R|foo/Sealed| {
            public constructor(x: R|kotlin/Int|): R|foo/Sealed.B| {
                super<R|foo/Sealed|>()
            }

            public final val x: R|kotlin/Int| = R|<local>/x|
                public get(): R|kotlin/Int|

            public final operator fun component1(): R|kotlin/Int|

            public final fun copy(x: R|kotlin/Int| = this@R|foo/Sealed.B|.R|foo/Sealed.B.x|): R|foo/Sealed.B|

        }

        public final data object C : R|foo/Sealed| {
            private constructor(): R|foo/Sealed.C| {
                super<R|foo/Sealed|>()
            }

        }

        public final data class D : R|foo/Sealed| {
            public constructor(y: R|kotlin/Int|): R|foo/Sealed.D| {
                super<R|foo/Sealed|>()
            }

            public final val y: R|kotlin/Int| = R|<local>/y|
                public get(): R|kotlin/Int|

            public final operator fun component1(): R|kotlin/Int|

            public final fun copy(y: R|kotlin/Int| = this@R|foo/Sealed.D|.R|foo/Sealed.D.y|): R|foo/Sealed.D|

        }

        public final data class String : R|foo/Sealed| {
            public constructor(t: R|kotlin/String|): R|foo/Sealed.String| {
                super<R|foo/Sealed|>()
            }

            public final val t: R|kotlin/String| = R|<local>/t|
                public get(): R|kotlin/String|

            public final operator fun component1(): R|kotlin/String|

            public final fun copy(t: R|kotlin/String| = this@R|foo/Sealed.String|.R|foo/Sealed.String.t|): R|foo/Sealed.String|

        }

        public final companion object Companion : R|kotlin/Any| {
            private constructor(): R|foo/Sealed.Companion| {
                super<R|kotlin/Any|>()
            }

            public final val CompanionA: R|foo/Sealed| = Q|foo/Sealed.A|
                public get(): R|foo/Sealed|

            public final val CompanionB: R|foo/Sealed| = Q|foo/Sealed.A|
                public get(): R|foo/Sealed|

        }

    }
    public final fun test(s: R|foo/Sealed|): R|kotlin/Int| {
        local final class B : R|kotlin/Any| {
            public constructor(): R|<local>/B| {
                super<R|kotlin/Any|>()
            }

        }

        lval CompanionB: R|kotlin/Int| = Int(0)
        ^test when (lval <when-subject>: R|foo/Sealed| = R|<local>/s|) {
            ($subj$ is R|<local>/B|) ->  {
                Int(2)
            }
            ==($subj$, Q|foo/Sealed.C|) ->  {
                Int(3)
            }
            ($subj$ is R|foo/Sealed.D|) ->  {
                Int(4)
            }
            ($subj$ is R|kotlin/String|) ->  {
                Int(5)
            }
            ==($subj$, R|<local>/CompanionB|) ->  {
                Int(7)
            }
            else ->  {
                Int(100)
            }
        }

    }
    public final fun testSealed(s: R|foo/Sealed|): R|kotlin/Int| {
        local final class B : R|kotlin/Any| {
            public constructor(): R|<local>/B| {
                super<R|kotlin/Any|>()
            }

        }

        lval CompanionB: R|kotlin/Int| = Int(0)
        ^testSealed when (lval <when-subject>: R|foo/Sealed| = R|<local>/s|) {
            ($subj$ is R|foo/Sealed.B|) ->  {
                Int(2)
            }
            ==($subj$, Q|foo/Sealed.C|) ->  {
                Int(3)
            }
            ($subj$ is R|foo/Sealed.D|) ->  {
                Int(4)
            }
            ($subj$ is R|foo/Sealed.String|) ->  {
                Int(5)
            }
            ==($subj$, Q|foo/Sealed|.R|foo/Sealed.Companion.CompanionB|) ->  {
                Int(7)
            }
            else ->  {
                Int(100)
            }
        }

    }
    public final class Test : R|kotlin/Any| {
        public constructor(): R|foo/Test| {
            super<R|kotlin/Any|>()
        }

        public final object A : R|kotlin/Any| {
            private constructor(): R|foo/Test.A| {
                super<R|kotlin/Any|>()
            }

        }

        public final class B : R|kotlin/Any| {
            public constructor(): R|foo/Test.B| {
                super<R|kotlin/Any|>()
            }

        }

        public final object CompanionA : R|kotlin/Any| {
            private constructor(): R|foo/Test.CompanionA| {
                super<R|kotlin/Any|>()
            }

        }

        public final val CompanionB: R|kotlin/Int| = Int(0)
            public get(): R|kotlin/Int|

        public final fun test(s: R|foo/Sealed|): R|kotlin/Int| {
            ^test when (lval <when-subject>: R|foo/Sealed| = R|<local>/s|) {
                ==($subj$, Q|foo/Test.A|) ->  {
                    Int(1)
                }
                ($subj$ is R|foo/Test.B|) ->  {
                    Int(2)
                }
                ==($subj$, Q|foo/Sealed.C|) ->  {
                    Int(3)
                }
                ($subj$ is R|foo/Sealed.D|) ->  {
                    Int(4)
                }
                ($subj$ is R|kotlin/String|) ->  {
                    Int(5)
                }
                ==($subj$, Q|foo/Test.CompanionA|) ->  {
                    Int(6)
                }
                ==($subj$, this@R|foo/Test|.R|foo/Test.CompanionB|) ->  {
                    Int(7)
                }
                else ->  {
                    Int(100)
                }
            }

        }

        public final fun testClass(s: R|foo/Sealed|): R|kotlin/Int| {
            ^testClass when (lval <when-subject>: R|foo/Sealed| = R|<local>/s|) {
                ==($subj$, Q|foo/Test.A|) ->  {
                    Int(1)
                }
                ($subj$ is R|foo/Test.B|) ->  {
                    Int(2)
                }
                ==($subj$, Q|foo/Sealed.C|) ->  {
                    Int(3)
                }
                ($subj$ is R|foo/Sealed.D|) ->  {
                    Int(4)
                }
                ($subj$ is R|kotlin/String|) ->  {
                    Int(5)
                }
                ==($subj$, Q|foo/Test.CompanionA|) ->  {
                    Int(6)
                }
                ==($subj$, this@R|foo/Test|.R|foo/Test.CompanionB|) ->  {
                    Int(7)
                }
                else ->  {
                    Int(100)
                }
            }

        }

        public final fun testSealed(s: R|foo/Sealed|): R|kotlin/Int| {
            ^testSealed when (lval <when-subject>: R|foo/Sealed| = R|<local>/s|) {
                ==($subj$, Q|foo/Sealed.A|) ->  {
                    Int(1)
                }
                ($subj$ is R|foo/Sealed.B|) ->  {
                    Int(2)
                }
                ==($subj$, Q|foo/Sealed.C|) ->  {
                    Int(3)
                }
                ($subj$ is R|foo/Sealed.D|) ->  {
                    Int(4)
                }
                ($subj$ is R|foo/Sealed.String|) ->  {
                    Int(5)
                }
                ==($subj$, Q|foo/Sealed|.R|foo/Sealed.Companion.CompanionA|) ->  {
                    Int(6)
                }
                ==($subj$, Q|foo/Sealed|.R|foo/Sealed.Companion.CompanionB|) ->  {
                    Int(7)
                }
                else ->  {
                    Int(100)
                }
            }

        }

    }
