From 7b108541a955b235a5a244d170ff2b0b0a47dd51 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Fri, 23 Nov 2018 14:23:51 +0300 Subject: [PATCH] [NI] Add test for obsolete issue It was fixed after c6712ff861b4f60bdf2948c8afad5f5a80078969 #KT-25182 Obsolete --- .../tests/generics/nullability/kt25182.kt | 14 +++++++++++++ .../tests/generics/nullability/kt25182.txt | 20 +++++++++++++++++++ .../checkers/DiagnosticsTestGenerated.java | 5 +++++ .../DiagnosticsUsingJavacTestGenerated.java | 5 +++++ 4 files changed, 44 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt create mode 100644 compiler/testData/diagnostics/tests/generics/nullability/kt25182.txt diff --git a/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt new file mode 100644 index 00000000000..3ed6a5ebf86 --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt @@ -0,0 +1,14 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_PARAMETER + +abstract class Expr + +class Sum(val e: Expr) : Expr() + +private fun times(e: Expr, element: V): Expr = TODO() + +private fun foo(e: Expr) {} + +fun test(intExpression: Expr) { + foo(Sum(times(intExpression, 42))) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/nullability/kt25182.txt b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.txt new file mode 100644 index 00000000000..7fa21bb865f --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.txt @@ -0,0 +1,20 @@ +package + +private fun foo(/*0*/ e: Expr): kotlin.Unit +public fun test(/*0*/ intExpression: Expr): kotlin.Unit +private fun times(/*0*/ e: Expr, /*1*/ element: V): Expr + +public abstract class Expr { + public constructor Expr() + 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 : Expr { + public constructor Sum(/*0*/ e: Expr) + public final val e: Expr + 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 +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 599bc702ee9..366c506443a 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -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"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index 577b1c63413..1ca10062d00 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -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");