Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.fir.kt
T
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00

54 lines
1.9 KiB
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
class A
class B
class C
class D
fun A.bar(x: Int = 0) = ""
fun A.bar(x: Int = 0, y: D.() -> Unit) = ""
fun B.bar(x: Int = 0) = ""
fun B.bar(x: Int = 0, y: D.() -> Unit) = ""
fun C.bar(x: Int = 0) = ""
fun C.bar(x: Int = 0, y: D.() -> Unit) = ""
class E {
fun foo() {
// `bar` calls are inapplicable since both E nor D aren't proper receivers
// But prior to this change, every lambda was analyzed repeatedly for every candidate
// Thus, the resulting time was exponential
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
<!NONE_APPLICABLE!>bar<!> {
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}