diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt new file mode 100644 index 00000000000..25a5802e858 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt @@ -0,0 +1,20 @@ +interface ICell { + val x: T +} + +class Cell(override val x: T): ICell + +open class Base { + typealias CT = Cell + inner class InnerCell(override val x: T): ICell +} + +class Derived : Base() { + // TODO KT-11123 + + val x1: InnerCell = InnerCell(42) + val x2: Base.InnerCell = InnerCell(42) + + val test1: CT = Cell(42) + val test2: Base.CT = Cell(42) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt new file mode 100644 index 00000000000..2f82081dc3b --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt @@ -0,0 +1,43 @@ +package + +public open class Base { + public typealias CT /*captured type parameters: /*0*/ T*/ = Cell + public constructor Base() + 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 inner class InnerCell /*captured type parameters: /*0*/ T*/ : ICell { + public constructor InnerCell(/*0*/ x: T) + public open override /*1*/ val x: 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 Cell : ICell { + public constructor Cell(/*0*/ x: T) + public open override /*1*/ val x: 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 Derived : Base { + public constructor Derived() + public final val test1: [ERROR : CT] + public final val test2: Base.CT [= Cell] + public final val x1: [ERROR : InnerCell] + public final val x2: Base.InnerCell + 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 interface ICell { + public abstract val x: 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 +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 73785271f9d..b25a92d7b02 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -19533,6 +19533,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("inheritedNestedTypeAlias.kt") + public void testInheritedNestedTypeAlias() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt"); + doTest(fileName); + } + @TestMetadata("isAsWithTypeAlias.kt") public void testIsAsWithTypeAlias() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.kt");