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
|
||||
@@ -0,0 +1,5 @@
|
||||
fun test(): Int {
|
||||
val sets = (1..100).associateWith { (it..10 * it).mapTo(java.util.TreeSet()) { i -> i } }
|
||||
val set = sets[50] ?: emptySet()
|
||||
return set.<!UNRESOLVED_REFERENCE!>size<!>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun test(): Int {
|
||||
val sets = (1..100).associateWith { (it..10 * it).mapTo(java.util.TreeSet()) { i -> i } }
|
||||
val set = sets[50] ?: emptySet()
|
||||
return set.size
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Int
|
||||
@@ -0,0 +1,5 @@
|
||||
data class A(val x: Set<CLassNotFound> = setOf()) {
|
||||
fun with(x: Set<CLassNotFound>? = null) {
|
||||
A(x ?: this.x)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
data class A(val x: Set<<!UNRESOLVED_REFERENCE!>CLassNotFound<!>> = setOf()) {
|
||||
fun with(x: Set<<!UNRESOLVED_REFERENCE!>CLassNotFound<!>>? = null) {
|
||||
A(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>x<!> ?: this.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>x<!>)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public final data class A {
|
||||
public constructor A(/*0*/ x: kotlin.collections.Set<[ERROR : CLassNotFound]> = ...)
|
||||
public final val x: kotlin.collections.Set<[ERROR : CLassNotFound]>
|
||||
public final operator /*synthesized*/ fun component1(): kotlin.collections.Set<[ERROR : CLassNotFound]>
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.collections.Set<[ERROR : CLassNotFound]> = ...): A
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
public final fun with(/*0*/ x: kotlin.collections.Set<[ERROR : CLassNotFound]>? = ...): kotlin.Unit
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import java.net.URI
|
||||
|
||||
fun <T> WebClient.myPost(uri: URI, body: Any, extract: WebClient.ResponseSpec.() -> Mono<T>): Mono<T> = TODO()
|
||||
|
||||
class RestClient(private val webClient: WebClient) {
|
||||
fun post(outDto: OutDto): Mono<InDto> =
|
||||
webClient.myPost(URI("http:/localhost:8080"), outDto) { bodyToMono() }
|
||||
}
|
||||
|
||||
class Mono<T>
|
||||
|
||||
class WebClient {
|
||||
fun post() {}
|
||||
|
||||
interface ResponseSpec {
|
||||
fun <T> bodyToMono(): Mono<T>
|
||||
}
|
||||
}
|
||||
|
||||
class OutDto
|
||||
class InDto
|
||||
@@ -0,0 +1,48 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> WebClient.myPost(/*0*/ uri: java.net.URI, /*1*/ body: kotlin.Any, /*2*/ extract: WebClient.ResponseSpec.() -> Mono<T>): Mono<T>
|
||||
|
||||
public final class InDto {
|
||||
public constructor InDto()
|
||||
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
|
||||
}
|
||||
|
||||
public final class Mono</*0*/ T> {
|
||||
public constructor Mono</*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
|
||||
}
|
||||
|
||||
public final class OutDto {
|
||||
public constructor OutDto()
|
||||
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
|
||||
}
|
||||
|
||||
public final class RestClient {
|
||||
public constructor RestClient(/*0*/ webClient: WebClient)
|
||||
private final val webClient: WebClient
|
||||
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 final fun post(/*0*/ outDto: OutDto): Mono<InDto>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class WebClient {
|
||||
public constructor WebClient()
|
||||
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 final fun post(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public interface ResponseSpec {
|
||||
public abstract fun </*0*/ T> bodyToMono(): Mono<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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user