[NI] Add test for obsolete issue
It was fixed after c6712ff861
#KT-25182 Obsolete
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
abstract class Expr<T>
|
||||
|
||||
class Sum<K>(val e: Expr<K>) : Expr<K?>()
|
||||
|
||||
private fun <V> times(e: Expr<V>, element: V): Expr<V> = TODO()
|
||||
|
||||
private fun <S> foo(e: Expr<S>) {}
|
||||
|
||||
fun test(intExpression: Expr<Int>) {
|
||||
foo(Sum(times(intExpression, 42)))
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
private fun </*0*/ S> foo(/*0*/ e: Expr<S>): kotlin.Unit
|
||||
public fun test(/*0*/ intExpression: Expr<kotlin.Int>): kotlin.Unit
|
||||
private fun </*0*/ V> times(/*0*/ e: Expr<V>, /*1*/ element: V): Expr<V>
|
||||
|
||||
public abstract class Expr</*0*/ T> {
|
||||
public constructor Expr</*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 Sum</*0*/ K> : Expr<K?> {
|
||||
public constructor Sum</*0*/ K>(/*0*/ e: Expr<K>)
|
||||
public final val e: Expr<K>
|
||||
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
|
||||
}
|
||||
@@ -8425,6 +8425,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/nullability/inferNotNullTypeFromIntersectionOfNullableTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt25182.kt")
|
||||
public void testKt25182() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullToGeneric.kt")
|
||||
public void testNullToGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.kt");
|
||||
|
||||
Generated
+5
@@ -8425,6 +8425,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/generics/nullability/inferNotNullTypeFromIntersectionOfNullableTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt25182.kt")
|
||||
public void testKt25182() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullToGeneric.kt")
|
||||
public void testNullToGeneric() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/generics/nullability/nullToGeneric.kt");
|
||||
|
||||
Reference in New Issue
Block a user