Test for obsolete KT-3343
#KT-3343 Obsolete
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
// KT-3343 Type mismatch when function literal consists of try-catch with Int returning call, and Unit is expected
|
||||||
|
|
||||||
|
fun main(args : Array<String>) {
|
||||||
|
"hello world".prt{
|
||||||
|
try{
|
||||||
|
print(it)
|
||||||
|
log("we are printing")
|
||||||
|
}
|
||||||
|
catch(e : Exception){
|
||||||
|
log("Exception")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun log(str : String) : Int{
|
||||||
|
print("logging $str")
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fun print(<!UNUSED_PARAMETER!>obj<!>: Any) {}
|
||||||
|
|
||||||
|
|
||||||
|
fun String.prt(action : (String) -> Unit){
|
||||||
|
action(this)
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun log(/*0*/ str: kotlin.String): kotlin.Int
|
||||||
|
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||||
|
public fun print(/*0*/ obj: kotlin.Any): kotlin.Unit
|
||||||
|
public fun kotlin.String.prt(/*0*/ action: (kotlin.String) -> kotlin.Unit): kotlin.Unit
|
||||||
@@ -6282,6 +6282,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt3343.kt")
|
||||||
|
public void testKt3343() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/functionLiterals/kt3343.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt4529.kt")
|
@TestMetadata("kt4529.kt")
|
||||||
public void testKt4529() throws Exception {
|
public void testKt4529() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/functionLiterals/kt4529.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/functionLiterals/kt4529.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user