Don't report the same diagnsotics several times

This commit is contained in:
Victor Petukhov
2021-05-26 12:58:48 +03:00
parent e942052eb6
commit 4a767c597e
62 changed files with 202 additions and 166 deletions
@@ -1,3 +1,4 @@
// !WITH_NEW_INFERENCE
//KT-4711 Error type with no error reported from type inference
fun main() {
@@ -6,15 +7,15 @@ fun main() {
val startTimeNanos = System.nanoTime()
// the problem sits on the next line:
val pi = 4.0.toDouble() * delta * (1..n).reduce(
val pi = 4.0.toDouble() * delta <!OVERLOAD_RESOLUTION_AMBIGUITY{OI}!>*<!> (1..n).<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}!>reduce<!>(
{t, i ->
val x = (i - 0.5) * delta
<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>t + 1.0 / (1.0 + x * x)<!>
<!TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}!>t + 1.0 / (1.0 + x * x)<!>
})
// !!! pi has error type here
val elapseTime = (System.nanoTime() - startTimeNanos) / 1e9
println("pi_sequential_reduce $pi $n $elapseTime")
println("pi_sequential_reduce $<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}!>pi<!> $n $elapseTime")
}