Add a test with false positive "inferred into empty intersection"

Related to KT-50232
This commit is contained in:
Mikhail Glukhikh
2022-08-12 16:09:50 +02:00
committed by Space
parent d3eedd791e
commit a6b90fcb8e
7 changed files with 65 additions and 0 deletions
@@ -0,0 +1,11 @@
fun test() {
acceptMyRecursive(<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>inferType<!><<!UPPER_BOUND_VIOLATED!>MyRecursive?<!>>())
}
fun acceptMyRecursive(value: MyRecursive?) {}
fun <R : Recursive<R>?> inferType(): R = TODO()
abstract class Recursive<R>
class MyRecursive : Recursive<MyRecursive>()
@@ -0,0 +1,11 @@
fun test() {
acceptMyRecursive(<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>inferType<!><<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>MyRecursive?<!>>())
}
fun acceptMyRecursive(value: MyRecursive?) {}
fun <R : Recursive<R>?> inferType(): R = TODO()
abstract class Recursive<R>
class MyRecursive : Recursive<MyRecursive>()
@@ -0,0 +1,19 @@
package
public fun acceptMyRecursive(/*0*/ value: MyRecursive?): kotlin.Unit
public fun </*0*/ R : Recursive<R>?> inferType(): R
public fun test(): kotlin.Unit
public final class MyRecursive : Recursive<MyRecursive> {
public constructor MyRecursive()
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 abstract class Recursive</*0*/ R> {
public constructor Recursive</*0*/ R>()
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
}