Add tests for obsolete issues

#KT-32207 Obsolete
 #KT-32836 Obsolete
 #KT-32949 Obsolete
 #KT-9384 Obsolete
This commit is contained in:
Mikhail Zarechenskiy
2019-08-15 10:58:38 +03:00
parent 1969ad6e9d
commit d59b910403
15 changed files with 183 additions and 0 deletions
@@ -0,0 +1,15 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Test<X, T> {
fun hereIdeaFail(values : List<Int>, others : List<String>): List<Test<out Int, out String>> {
return values.map { left(it) }.plus(others.map { right(it) })
}
companion object {
fun <L> left(left: L): Test<L, Nothing> = TODO()
fun <R> right(right: R): Test<Nothing, R> = TODO()
}
}
fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R> = TODO()
operator fun <T> Collection<T>.plus(elements: Iterable<T>): List<T> = TODO()
@@ -0,0 +1,21 @@
package
public fun </*0*/ T, /*1*/ R> kotlin.collections.Iterable<T>.map(/*0*/ transform: (T) -> R): kotlin.collections.List<R>
public operator fun </*0*/ T> kotlin.collections.Collection<T>.plus(/*0*/ elements: kotlin.collections.Iterable<T>): kotlin.collections.List<T>
public final class Test</*0*/ X, /*1*/ T> {
public constructor Test</*0*/ X, /*1*/ 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 final fun hereIdeaFail(/*0*/ values: kotlin.collections.List<kotlin.Int>, /*1*/ others: kotlin.collections.List<kotlin.String>): kotlin.collections.List<Test<out kotlin.Int, out kotlin.String>>
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public companion object Companion {
private constructor Companion()
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 </*0*/ L> left(/*0*/ left: L): Test<L, kotlin.Nothing>
public final fun </*0*/ R> right(/*0*/ right: R): Test<kotlin.Nothing, R>
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline fun <reified T> parse(json: String): T? = TODO()
class MyType
fun parseMyData(json: String): MyType =
try {
parse(json) // error with new inf only: Cannot use 'Nothing?' as reified type parameter
?: throw IllegalArgumentException("Can't parse")
} catch (e: Exception) {
throw IllegalArgumentException("Can't parse")
}
fun main() {
parseMyData("")
}
@@ -0,0 +1,12 @@
package
public fun main(): kotlin.Unit
public inline fun </*0*/ reified T> parse(/*0*/ json: kotlin.String): T?
public fun parseMyData(/*0*/ json: kotlin.String): MyType
public final class MyType {
public constructor MyType()
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,11 @@
fun main(args: Array<String>) {
fun f() = run {
<!WRONG_MODIFIER_TARGET!>private<!> class C {
private fun foo() {
<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!><!DEBUG_INFO_MISSING_UNRESOLVED!>f<!>()<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>foo<!>();
}
}
C()
}
}
@@ -0,0 +1,3 @@
package
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit