Files
kotlin-fork/compiler/testData/diagnostics/tests/functionLiterals/underscopeParameters.fir.kt
T
Ivan Kochurkin 1a40164ef0 [FIR] Fix resolving of single underscore _
Now compiler throws `UNRESOLVED_REFERENCE` here:

```
val boo = { _: Exception -> `_`.stackTrace }
```
2021-07-30 16:58:07 +00:00

49 lines
951 B
Kotlin
Vendored

// !CHECK_TYPE
fun foo(block: (Int, String) -> Unit) { }
fun foobar(block: (Double) -> Unit) { }
fun bar() {
foo { _, b ->
<!UNRESOLVED_REFERENCE!>_<!>.hashCode()
b checkType { _<String>() }
}
foo { a, _ ->
a checkType { _<Int>() }
<!UNRESOLVED_REFERENCE!>_<!>.hashCode()
}
foo { _, _ ->
<!UNRESOLVED_REFERENCE!>_<!>.hashCode()
}
foo { _: Int, b: String ->
<!UNRESOLVED_REFERENCE!>_<!>.hashCode()
b checkType { _<String>() }
}
foo { a: Int, _: String ->
a checkType { _<Int>() }
<!UNRESOLVED_REFERENCE!>_<!>.hashCode()
}
foo { _: Int, _: String ->
<!UNRESOLVED_REFERENCE!>_<!>.hashCode()
}
foo { `_`, _ ->
_ checkType { _<Int>() }
}
foo { _, `_` ->
_ checkType { _<String>() }
}
foo { `_`, `_` ->
_ checkType { _<String>() }
}
foo(fun(x: Int, _: String) {})
}