d46075a9db
Before, we were wrapping the original constraint position into ConeBuilderInferenceSubstitutionConstraintPosition twice during the constraint substitution in builder inference. It was causing problems with diagnostic reporting. Remove TODOs about diagnostic reporting from FirBuilderInferenceSession. Propagation of errors from the common system is now implemented Diagnostic reporting in updateCalls isn't needed, since we report errors after the system completion unlike K1 Relates to KT-53749
25 lines
757 B
Kotlin
Vendored
25 lines
757 B
Kotlin
Vendored
class Foo<T : Any> {
|
|
fun doSmthng(arg: T) {}
|
|
var a: T? = null
|
|
}
|
|
|
|
fun <T : Any> myBuilder(block: Foo<T>.() -> Unit) : Foo<T> = Foo<T>().apply(block)
|
|
|
|
fun main(arg: Any) {
|
|
val x = 57
|
|
val value = <!TYPE_MISMATCH, TYPE_MISMATCH!>myBuilder {
|
|
doSmthng("one ")
|
|
run { a; this }.a = 10
|
|
<!BUILDER_INFERENCE_STUB_RECEIVER!>a += 1<!>
|
|
this.a = 57
|
|
this.<!ILLEGAL_SELECTOR, VARIABLE_EXPECTED!>(a)<!> = 57
|
|
a = x
|
|
(a) = x
|
|
a.<!FUNCTION_CALL_EXPECTED, VARIABLE_EXPECTED!>hashCode<!> = 99
|
|
if (arg is String) {
|
|
a = arg
|
|
}
|
|
}<!>
|
|
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value.a?.<!UNRESOLVED_REFERENCE!>count<!> { <!UNRESOLVED_REFERENCE!>it<!> in 'l' .. 'q' })
|
|
}
|