From b5524255582c0393603da0e1372b6a41db56986d Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 8 Jun 2016 16:38:05 +0300 Subject: [PATCH] Tests for type alias diagnostics: type projections in type alias constructor (should report same errors as for classes) --- .../typealias/projectionsInTypeAliasConstructor.kt | 6 ++++++ .../typealias/projectionsInTypeAliasConstructor.txt | 13 +++++++++++++ .../kotlin/checkers/DiagnosticsTestGenerated.java | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.kt create mode 100644 compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.txt diff --git a/compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.kt new file mode 100644 index 00000000000..8e759df35e3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.kt @@ -0,0 +1,6 @@ +class In(val x: Any) + +typealias InAlias = In + +val test1 = In<out String>("") +val test2 = InAlias<out String>("") diff --git a/compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.txt b/compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.txt new file mode 100644 index 00000000000..f0648e2a09b --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.txt @@ -0,0 +1,13 @@ +package + +public typealias InAlias = In +public val test1: In +public val test2: In + +public final class In { + public constructor In(/*0*/ x: kotlin.Any) + public final val x: kotlin.Any + 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 d37f3fd8615..e3ae923d5ec 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -19521,6 +19521,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("projectionsInTypeAliasConstructor.kt") + public void testProjectionsInTypeAliasConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/projectionsInTypeAliasConstructor.kt"); + doTest(fileName); + } + @TestMetadata("recursive.kt") public void testRecursive() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/recursive.kt");