Add tests for obsolete issues
#KT-38092 Obsolete #KT-38179 Obsolete #KT-35105 Obsolete #KT-36696 Obsolete #KT-36947 Obsolete #KT-37337 Obsolete #KT-37309 Obsolete #KT-37727 Obsolete #KT-37735 Obsolete #KT-37853 Obsolete #KT-37920 Obsolete #KT-37709 Obsolete #KT-37706 Obsolete
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun test1(): List<Int> = buildList {
|
||||
add(1)
|
||||
reverse()
|
||||
add(4)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun test2(): Map<Int, Int> = buildMap {
|
||||
put(0, 0)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
@kotlin.OptIn(markerClass = {kotlin.ExperimentalStdlibApi::class}) public fun test1(): kotlin.collections.List<kotlin.Int>
|
||||
@kotlin.OptIn(markerClass = {kotlin.ExperimentalStdlibApi::class}) public fun test2(): kotlin.collections.Map<kotlin.Int, kotlin.Int>
|
||||
@@ -0,0 +1,6 @@
|
||||
val foo = iterator {
|
||||
yield(0)
|
||||
val nullable: String? = null
|
||||
nullable<!UNSAFE_CALL!>.<!>length
|
||||
nullable<!UNSAFE_CALL!>.<!>get(2)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public val foo: kotlin.collections.Iterator<kotlin.Int>
|
||||
@@ -0,0 +1,24 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <E> myBuildList(@BuilderInference builderAction: MutableList<E>.() -> Unit) {
|
||||
ArrayList<E>().builderAction()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun main() {
|
||||
val newList1 = myBuildList {
|
||||
addAll(
|
||||
listOf(1).map { Foo(<!NULL_FOR_NONNULL_TYPE!>null<!>) }
|
||||
)
|
||||
}
|
||||
|
||||
val newList2 = buildList {
|
||||
addAll(listOf(1,2,3).map{ Foo(<!NULL_FOR_NONNULL_TYPE!>null<!>) })
|
||||
}
|
||||
}
|
||||
|
||||
class Foo(val notNullProp: String)
|
||||
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
@kotlin.OptIn(markerClass = {kotlin.ExperimentalStdlibApi::class}) public fun main(): kotlin.Unit
|
||||
@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> myBuildList(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableList<E>.() -> kotlin.Unit): kotlin.Unit
|
||||
|
||||
public final class Foo {
|
||||
public constructor Foo(/*0*/ notNullProp: kotlin.String)
|
||||
public final val notNullProp: kotlin.String
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// FULL_JDK
|
||||
|
||||
import java.util.*
|
||||
import kotlin.collections.HashMap
|
||||
|
||||
typealias MyType = String
|
||||
enum class MyEnum { FOO, BAR }
|
||||
enum class MyOtherEnum { A, B, C }
|
||||
|
||||
private fun buildMapOfMaps(): Map<MyType, Map<MyEnum, MyOtherEnum>> {
|
||||
val results = HashMap<Pair<MyType, MyEnum>, MyOtherEnum>()
|
||||
return results
|
||||
.asSequence()
|
||||
.groupingBy { it.key.first }
|
||||
.fold(
|
||||
{ _, _ -> (EnumMap(MyEnum::class.java)) },
|
||||
{ _, accumulator, element -> accumulator.also { map -> map[element.key.second] = element.value } }
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package
|
||||
|
||||
private fun buildMapOfMaps(): kotlin.collections.Map<MyType /* = kotlin.String */, kotlin.collections.Map<MyEnum, MyOtherEnum>>
|
||||
|
||||
public final enum class MyEnum : kotlin.Enum<MyEnum> {
|
||||
enum entry FOO
|
||||
|
||||
enum entry BAR
|
||||
|
||||
private constructor MyEnum()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<MyEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<MyEnum>
|
||||
}
|
||||
|
||||
public final enum class MyOtherEnum : kotlin.Enum<MyOtherEnum> {
|
||||
enum entry A
|
||||
|
||||
enum entry B
|
||||
|
||||
enum entry C
|
||||
|
||||
private constructor MyOtherEnum()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: MyOtherEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<MyOtherEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): MyOtherEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<MyOtherEnum>
|
||||
}
|
||||
public typealias MyType = kotlin.String
|
||||
Reference in New Issue
Block a user