Minor. Added regression tests for: KT-3927, KT-9522, KT-10036, KT-7440, KT-9682, KT-9808, KT-9517, KT-9810, KT-9345.

This commit is contained in:
Stanislav Erokhin
2016-01-24 15:39:51 +03:00
parent 298a075381
commit 210c9ab3db
21 changed files with 311 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER
// KT-7440 Cannot complete type inference if two extension functions for interface hierarchy
package inferenceagain
interface Base<T>
interface Derived<T> : Base<T>
fun <R : Comparable<R>, T : Any> Base<T>.maxBy(f: (T) -> R): T? = null
fun <R : Comparable<R>, T : Any> Derived<T>.maxBy(f: (T) -> R): T? = null
fun <T> derivedOf(vararg members: T): Derived<T> = null!!
fun <T> x(l: Derived<T>) {
derivedOf(1, 2, 3).maxBy<Int, Int> { it } // works
derivedOf(1, 2, 3).maxBy { it } // should work
}