Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt
T
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00

112 lines
1.5 KiB
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// SKIP_TXT
class ExcA : Exception()
class ExcB : Exception()
fun test2() {
val s: String? = try {
""
}
catch (e: ExcA) {
null
}
catch (e: ExcB) {
10
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test3() {
val s: String? = try {
""
}
catch (e: ExcA) {
null
}
catch (e: ExcB) {
return
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test4() {
val s: String? = try {
""
}
catch (e: ExcA) {
null
}
finally {
""
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test5() {
val s: String? = try {
""
}
catch (e: ExcA) {
null
}
finally {
return
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test6() {
val s: String? = try {
""
}
catch (e: ExcA) {
return
}
catch (e: ExcB) {
return
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test7() {
val s: String? = try {
""
}
catch (e: ExcA) {
""
}
catch (e: ExcB) {
""
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test8() {
val s = try {
""
} catch (e: ExcA) {
null
}
s.<!INAPPLICABLE_CANDIDATE!>length<!>
}
fun test9() {
val s = try {
""
} catch (e: ExcA) {
""
}
s.length
}
fun test10() {
val x = try {
""
} finally {
42
}
x.length
}