mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 00:21:28 +00:00
This commits introduces testdata changes, where NI behaviour strictly improved, after several previous fixes. For some tests, just WITH_NEW_INFERENCE directive was added. It indicates, that some of previous commits first introduced error in that test, and then some other commit fixed it (netting no overall testdata change). It is preferrably to keep those annotations until we will migrate to NI completely, to prevent unexpected regressions.
21 lines
653 B
Kotlin
Vendored
21 lines
653 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
package a
|
|
|
|
class MyClass {
|
|
fun component1(<!UNUSED_PARAMETER!>i<!>: Int) {}
|
|
}
|
|
|
|
class MyClass2 {}
|
|
|
|
<!CONFLICTING_OVERLOADS!>fun MyClass2.component1()<!> = 1.2
|
|
<!CONFLICTING_OVERLOADS!>fun MyClass2.component1()<!> = 1.3
|
|
|
|
fun test(mc1: MyClass, mc2: MyClass2) {
|
|
val (<!OPERATOR_MODIFIER_REQUIRED!>a<!>, b) = <!COMPONENT_FUNCTION_MISSING, COMPONENT_FUNCTION_MISSING!>mc1<!>
|
|
val (c) = <!COMPONENT_FUNCTION_AMBIGUITY!>mc2<!>
|
|
|
|
//a,b,c are error types
|
|
use(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>, <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>b<!>, <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>c<!>)
|
|
}
|
|
|
|
fun use(vararg a: Any?) = a |