Files
kotlin-fork/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts
T
Mikhail Zarechenskiy bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00

17 lines
328 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
val (a1, a2) = A()
val (b1: Int, b2: Int) = <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>A()<!>
val (c1) = <!UNRESOLVED_REFERENCE!>unresolved<!>
<!WRONG_MODIFIER_TARGET!>private<!> val (d1) = A()
val (e1, _) = A()
a1
a2
e1
class A {
operator fun component1() = 1
operator fun component2() = ""
}