// !WITH_NEW_INFERENCE // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_PARAMETER data class A(val x: Int, val y: String) data class B(val u: Double, val w: Short) fun foo(block: (A) -> Unit) { } fun foobar(block: (A, B) -> Unit) { } fun bar() { foo { (a, b) -> a checkType { _() } b checkType { _() } } foo { (a: Int, b: String) -> a checkType { _() } b checkType { _() } } foo { (a, b): A -> a checkType { _() } b checkType { _() } } foobar { (a, b), c -> a checkType { _() } b checkType { _() } c checkType { _() } } foobar { a, (b, c) -> a checkType { _() } b checkType { _() } c checkType { _() } } foobar { (a, b), (c, d) -> a checkType { _() } b checkType { _() } c checkType { _() } d checkType { _() } } foo { (a: String, b) -> a checkType { _() } b checkType { _() } } foo { (a, b): B -> a checkType { _() } b checkType { _() } } }