Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.kt
T
Mikhail Zarechenskiy 932d84d568 Fix performance regression in NI by fixing totally incorrect hashCode
The actual problem was introduced in 4f1e85b468, note how `hashCode` is implemented:
```
var currentHashCode = cachedHashCode
if (currentHashCode == 0) return currentHashCode
...
```
It's a silly bug, there should be check `if (currentHashCode != 0) ...` because `0` is used a marker for "uncomputed value".

Now, in the commit 0219b86d06 I added map with `KotlinType` as a key and because of constant `hash` for `KotlinType`, we basically got `List` instead of `Map`, which caused this performance regression

 #KT-34063 Fixed
2019-09-30 10:22:30 +03:00

178 lines
3.2 KiB
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
val prop = mapOf(
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b"),
to("a", "b")
)
fun <A, B> to(a: A, b: B): Pair<A, B> = TODO()
fun <K, V> mapOf(vararg pairs: Pair<K, V>): Map<K, V> = TODO()
class Pair<out A, out B>