From eba7d1ec526681d46d2fc2ef0b4ea330f922860e Mon Sep 17 00:00:00 2001 From: Anders Fugmann Date: Tue, 7 Jul 2026 15:30:52 +0200 Subject: [PATCH] kotlin tests: sync generated-throws.kt source between test-kotlin1 and test-kotlin2 Remove the K1-only comment '// This doesn't generate a throw statement in Kotlin 1 mode' from test-kotlin1/library-tests/generated-throws/generated-throws.kt so the source files are byte-identical between the two suites. The expected outputs still legitimately differ: in K2 mode the compiler generates an implicit throw NoWhenBranchMatchedException for the exhaustive sealed-class when expression, but the K1 frontend does not emit this node. This is a mode-specific behaviour difference that cannot be bridged by an extractor change. Both tests continue to pass: - test-kotlin1 (kotlinc 2.3.20 / -language 1.9): 0 throw results (unchanged) - test-kotlin2 (kotlinc 2.4.0 / -language 2.0): 1 throw result (unchanged) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../library-tests/generated-throws/generated-throws.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/java/ql/test-kotlin1/library-tests/generated-throws/generated-throws.kt b/java/ql/test-kotlin1/library-tests/generated-throws/generated-throws.kt index 4bbcec0dd21..a3e1dc12a60 100644 --- a/java/ql/test-kotlin1/library-tests/generated-throws/generated-throws.kt +++ b/java/ql/test-kotlin1/library-tests/generated-throws/generated-throws.kt @@ -4,7 +4,6 @@ interface Bar: Foo {} interface Baz: Foo {} private fun someFun(v: Foo) { - // This doesn't generate a throw statement in Kotlin 1 mode when (v) { is Bar -> {} is Baz -> {}