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
|
||||
Reference in New Issue
Block a user