mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Kotlin: Add test for generated throw statements
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
|
||||
sealed interface Foo {}
|
||||
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 -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from ThrowStmt ts
|
||||
select ts
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
sealed interface Foo {}
|
||||
interface Bar: Foo {}
|
||||
interface Baz: Foo {}
|
||||
|
||||
private fun someFun(v: Foo) {
|
||||
when (v) {
|
||||
is Bar -> {}
|
||||
is Baz -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
| generated-throws.kt:7:5:10:5 | throw ... |
|
||||
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from ThrowStmt ts
|
||||
select ts
|
||||
Reference in New Issue
Block a user