mirror of
https://github.com/github/codeql.git
synced 2026-07-08 21:15:32 +02:00
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>
This commit is contained in:
@@ -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 -> {}
|
||||
|
||||
Reference in New Issue
Block a user