[NI] Add test for obsolete issue

#KT-28658 Obsolete
This commit is contained in:
Mikhail Zarechenskiy
2019-04-12 15:20:40 +03:00
parent d5cd49b2bf
commit bdab7a88f6
7 changed files with 73 additions and 0 deletions
@@ -0,0 +1,34 @@
// !LANGUAGE: +NewInference
// !USE_EXPERIMENTAL: kotlin.Experimental
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
import kotlin.experimental.ExperimentalTypeInference
fun test1() {
sequence {
val a: Array<Int> = arrayOf(1, 2, 3)
val b = arrayOf(1, 2, 3)
}
}
fun test2() = sequence { arrayOf(1, 2, 3) }
class Foo<T>
fun <T> f1(f: Foo<T>.() -> Unit) {}
@UseExperimental(ExperimentalTypeInference::class)
fun <T> f2(@BuilderInference f: Foo<T>.() -> Unit) {
}
fun test3() {
f1 {
val a: Array<Int> = arrayOf(1, 2, 3)
}
f2 {
val a: Array<Int> = arrayOf(1, 2, 3)
}
}
@@ -0,0 +1,14 @@
package
public fun </*0*/ T> f1(/*0*/ f: Foo<T>.() -> kotlin.Unit): kotlin.Unit
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ T> f2(/*0*/ @kotlin.BuilderInference f: Foo<T>.() -> kotlin.Unit): kotlin.Unit
public fun test1(): kotlin.Unit
public fun test2(): kotlin.sequences.Sequence<kotlin.Any?>
public fun test3(): kotlin.Unit
public final class Foo</*0*/ T> {
public constructor Foo</*0*/ T>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}