diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 721e5ead1de..7a6164ebad6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -188,6 +188,8 @@ public interface Errors { DiagnosticFactory0 DELEGATION_IN_TRAIT = DiagnosticFactory0.create(ERROR); + DiagnosticFactory0 TRAIT_WITH_SUPERCLASS = DiagnosticFactory0.create(WARNING); + DiagnosticFactory2 UNMET_TRAIT_REQUIREMENT = DiagnosticFactory2.create(ERROR, PositioningStrategies.DECLARATION_NAME); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 42408115f65..ed88c4f0a1f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -385,6 +385,7 @@ public class DefaultErrorMessages { MAP.put(SUPERTYPE_INITIALIZED_IN_TRAIT, "Traits cannot initialize supertypes"); MAP.put(CLASS_IN_SUPERTYPE_FOR_ENUM, "Enum class cannot inherit from classes"); MAP.put(CONSTRUCTOR_IN_TRAIT, "A trait may not have a constructor"); + MAP.put(TRAIT_WITH_SUPERCLASS, "Specifying a required base class for trait implementations is deprecated"); MAP.put(SUPERTYPE_APPEARS_TWICE, "A supertype appears twice"); MAP.put(FINAL_SUPERTYPE, "This type is final, so it cannot be inherited from"); MAP.put(SINGLETON_IN_SUPERTYPE, "Cannot inherit from a singleton"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java index f08c6737a71..d0744a471ec 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java @@ -416,6 +416,10 @@ public class BodyResolver { if (supertypeOwner.getKind() == ClassKind.ENUM_CLASS) { trace.report(CLASS_IN_SUPERTYPE_FOR_ENUM.on(typeReference)); } + else if (supertypeOwner.getKind() == ClassKind.TRAIT && + !classAppeared && !TypesPackage.isDynamic(supertype) /* avoid duplicate diagnostics */) { + trace.report(TRAIT_WITH_SUPERCLASS.on(typeReference)); + } if (classAppeared) { trace.report(MANY_CLASSES_IN_SUPERTYPE_LIST.on(typeReference)); } diff --git a/compiler/testData/diagnostics/tests/DiamondFunction.kt b/compiler/testData/diagnostics/tests/DiamondFunction.kt index b22834a1978..9e171ba1dc1 100644 --- a/compiler/testData/diagnostics/tests/DiamondFunction.kt +++ b/compiler/testData/diagnostics/tests/DiamondFunction.kt @@ -1,8 +1,8 @@ -open class Base() { +trait Base { fun f() = 1 } -open class Left() : Base() +open class Left() : Base trait Right : Base diff --git a/compiler/testData/diagnostics/tests/DiamondFunction.txt b/compiler/testData/diagnostics/tests/DiamondFunction.txt index 2a8d20ae55e..d54c7c27135 100644 --- a/compiler/testData/diagnostics/tests/DiamondFunction.txt +++ b/compiler/testData/diagnostics/tests/DiamondFunction.txt @@ -1,9 +1,8 @@ package -internal open class Base { - public constructor Base() +internal trait Base { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun f(): kotlin.Int + internal open fun f(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -11,7 +10,7 @@ internal open class Base { internal final class Diamond : Left, Right { public constructor Diamond() public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*2*/ /*fake_override*/ fun f(): kotlin.Int + internal open override /*2*/ /*fake_override*/ fun f(): kotlin.Int public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String } @@ -19,14 +18,14 @@ internal final class Diamond : Left, Right { internal open class Left : Base { public constructor Left() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun f(): kotlin.Int + internal open override /*1*/ /*fake_override*/ fun f(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } internal trait Right : Base { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun f(): kotlin.Int + internal open override /*1*/ /*fake_override*/ fun f(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt index aa22ec900e8..3fe4f3a0c26 100644 --- a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt +++ b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt @@ -1,8 +1,8 @@ -open class Base

() { +trait Base

{ fun f() = 1 } -open class Left

() : Base

() +open class Left

() : Base

trait Right

: Base

diff --git a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.txt b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.txt index 33a0483db10..9d45d89013d 100644 --- a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.txt +++ b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.txt @@ -1,9 +1,8 @@ package -internal open class Base { - public constructor Base() +internal trait Base { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final fun f(): kotlin.Int + internal open fun f(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -11,7 +10,7 @@ internal open class Base { internal final class Diamond : Left

, Right

{ public constructor Diamond() public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*2*/ /*fake_override*/ fun f(): kotlin.Int + internal open override /*2*/ /*fake_override*/ fun f(): kotlin.Int public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String } @@ -19,14 +18,14 @@ internal final class Diamond : Left

, Right

{ internal open class Left : Base

{ public constructor Left() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun f(): kotlin.Int + internal open override /*1*/ /*fake_override*/ fun f(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } internal trait Right : Base

{ public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - internal final override /*1*/ /*fake_override*/ fun f(): kotlin.Int + internal open override /*1*/ /*fake_override*/ fun f(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/DiamondProperty.kt b/compiler/testData/diagnostics/tests/DiamondProperty.kt index 0f6099b0bf9..fcc8bc39372 100644 --- a/compiler/testData/diagnostics/tests/DiamondProperty.kt +++ b/compiler/testData/diagnostics/tests/DiamondProperty.kt @@ -1,9 +1,10 @@ - -open class Base() { - var v : Int = 0 +trait Base { + var v : Int + get() = 1 + set(v) {} } -open class Left() : Base() +open class Left() : Base trait Right : Base diff --git a/compiler/testData/diagnostics/tests/DiamondProperty.txt b/compiler/testData/diagnostics/tests/DiamondProperty.txt index 40473234a40..ba812b56e6e 100644 --- a/compiler/testData/diagnostics/tests/DiamondProperty.txt +++ b/compiler/testData/diagnostics/tests/DiamondProperty.txt @@ -1,8 +1,7 @@ package -internal open class Base { - public constructor Base() - internal final var v: kotlin.Int +internal trait Base { + internal open var v: kotlin.Int 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 @@ -10,7 +9,7 @@ internal open class Base { internal final class Diamond : Left, Right { public constructor Diamond() - internal final override /*2*/ /*fake_override*/ var v: kotlin.Int + internal open override /*2*/ /*fake_override*/ var v: kotlin.Int public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String @@ -18,14 +17,14 @@ internal final class Diamond : Left, Right { internal open class Left : Base { public constructor Left() - internal final override /*1*/ /*fake_override*/ var v: kotlin.Int + internal open override /*1*/ /*fake_override*/ var v: kotlin.Int 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 } internal trait Right : Base { - internal final override /*1*/ /*fake_override*/ var v: kotlin.Int + internal open override /*1*/ /*fake_override*/ var v: kotlin.Int 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/testData/diagnostics/tests/SupertypeListChecks.kt b/compiler/testData/diagnostics/tests/SupertypeListChecks.kt index 3b252bf16e7..3ef95fb2b33 100644 --- a/compiler/testData/diagnostics/tests/SupertypeListChecks.kt +++ b/compiler/testData/diagnostics/tests/SupertypeListChecks.kt @@ -24,17 +24,17 @@ trait T2 {} trait Test() { } -trait Test1 : C2() {} +trait Test1 : C2() {} -trait Test2 : C2 {} +trait Test2 : C2 {} -trait Test3 : C2, C3 {} +trait Test3 : C2, C3 {} trait Test4 : T1 {} trait Test5 : T1, T1 {} -trait Test6 : C1 {} +trait Test6 : C1 {} class CTest1() : OC1() {} diff --git a/compiler/testData/diagnostics/tests/TraitOverrideObjectMethods.kt b/compiler/testData/diagnostics/tests/TraitOverrideObjectMethods.kt index 92411590a8f..7361b31d2d3 100644 --- a/compiler/testData/diagnostics/tests/TraitOverrideObjectMethods.kt +++ b/compiler/testData/diagnostics/tests/TraitOverrideObjectMethods.kt @@ -1,4 +1,4 @@ -trait MyTrait: Object { +trait MyTrait: Object { override fun toString(): String public override fun finalize() public override fun wait() diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/require.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/require.kt index 5e7f5d2fa85..77a52be51e5 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/require.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/require.kt @@ -2,6 +2,6 @@ open class C { val x = 1 } -trait Tr : C { +trait Tr : C { fun getX() = 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.kt b/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.kt index 002bcd0def1..f0958284d4f 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.kt @@ -1,4 +1,5 @@ -trait X: Any?? { +trait A +trait X: A?? { } diff --git a/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.txt b/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.txt index 04bf7d3a903..553d0ba53e3 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.txt +++ b/compiler/testData/diagnostics/tests/nullableTypes/redundantNullableInSupertype.txt @@ -2,7 +2,13 @@ package internal fun interaction(/*0*/ t: T): kotlin.Unit -internal trait X { +internal trait A { + 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 +} + +internal trait X : A? { 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/testData/diagnostics/tests/override/kt1862.kt b/compiler/testData/diagnostics/tests/override/kt1862.kt index 4694754c909..bd70fba2f22 100644 --- a/compiler/testData/diagnostics/tests/override/kt1862.kt +++ b/compiler/testData/diagnostics/tests/override/kt1862.kt @@ -6,6 +6,6 @@ open class Bbb() : Aaa() { override fun foo() = 2 } -trait Ccc : Aaa +trait Ccc : Aaa class Ddd() : Bbb(), Ccc \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt307.kt b/compiler/testData/diagnostics/tests/regressions/kt307.kt index f8a60f9485b..3cbb585a647 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt307.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt307.kt @@ -4,7 +4,7 @@ open class AL { fun get(i : Int) : Any? = i } -trait ALE : AL { +trait ALE : AL { fun getOrNull(index: Int, value: T) : T { return get(index) as? T ?: value } diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/notAccessibleSuperInTrait.kt b/compiler/testData/diagnostics/tests/thisAndSuper/notAccessibleSuperInTrait.kt index 7a4996bf3dc..52dcd4e77da 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/notAccessibleSuperInTrait.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/notAccessibleSuperInTrait.kt @@ -2,7 +2,7 @@ open class A { open fun foo() {} } -trait ATrait : A { +trait ATrait : A { override fun foo() { super.foo() diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/abstractClass.kt b/compiler/testData/diagnostics/tests/traitWithRequired/abstractClass.kt index 0d5c4873760..9d692f9770a 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/abstractClass.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/abstractClass.kt @@ -1,6 +1,6 @@ open class Required -trait Trait : Required +trait Trait : Required abstract class Abstract : Trait diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/anonymousObjectExtendsTraitWithRequired.kt b/compiler/testData/diagnostics/tests/traitWithRequired/anonymousObjectExtendsTraitWithRequired.kt index ae8dbeffa34..526735148e5 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/anonymousObjectExtendsTraitWithRequired.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/anonymousObjectExtendsTraitWithRequired.kt @@ -1,6 +1,6 @@ open class Required -trait A : Required +trait A : Required val a = object : A {} val b: A = object : A, Required() {} diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/differentGenericArguments.kt b/compiler/testData/diagnostics/tests/traitWithRequired/differentGenericArguments.kt index 2036111c163..07219c7e9e0 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/differentGenericArguments.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/differentGenericArguments.kt @@ -1,8 +1,8 @@ open class Generic -trait A : Generic +trait A : Generic -trait B : Generic +trait B : Generic class Y : A, B class Z : A, B, Generic() diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/kt3006.kt b/compiler/testData/diagnostics/tests/traitWithRequired/kt3006.kt index 1647879626d..af94dbd8859 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/kt3006.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/kt3006.kt @@ -1,7 +1,7 @@ open class Base { } -trait Derived: Base { +trait Derived: Base { fun foo() { f1(this@Derived) } diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/manyRequirementsDisallowed.kt b/compiler/testData/diagnostics/tests/traitWithRequired/manyRequirementsDisallowed.kt index fd2290e4b9f..9b665610693 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/manyRequirementsDisallowed.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/manyRequirementsDisallowed.kt @@ -1,4 +1,4 @@ open class A open class B -trait C : A, B +trait C : A, B \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/manyTraitsRequireSameClass.kt b/compiler/testData/diagnostics/tests/traitWithRequired/manyTraitsRequireSameClass.kt index cc313c91258..31275536e00 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/manyTraitsRequireSameClass.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/manyTraitsRequireSameClass.kt @@ -1,12 +1,12 @@ open class Required -trait A : Required +trait A : Required -trait B : A, Required +trait B : A, Required -trait C : Required +trait C : Required -trait D : B, Required +trait D : B, Required class W : D class X : D, Required() diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/requirementFulfilledBySubclass.kt b/compiler/testData/diagnostics/tests/traitWithRequired/requirementFulfilledBySubclass.kt index deb366850f0..0199b50f515 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/requirementFulfilledBySubclass.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/requirementFulfilledBySubclass.kt @@ -1,6 +1,6 @@ open class RequiredBase -trait Trait : RequiredBase +trait Trait : RequiredBase open class RequiredDerived : RequiredBase() diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/traitExtendsTraitWithRequired.kt b/compiler/testData/diagnostics/tests/traitWithRequired/traitExtendsTraitWithRequired.kt index fec070bae77..500ac2773c7 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/traitExtendsTraitWithRequired.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/traitExtendsTraitWithRequired.kt @@ -1,6 +1,6 @@ open class Required(val value: String) -trait First : Required +trait First : Required trait Second : First diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/traitRequiresAny.kt b/compiler/testData/diagnostics/tests/traitWithRequired/traitRequiresAny.kt index 85f253285d0..530eeb6df11 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/traitRequiresAny.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/traitRequiresAny.kt @@ -1,4 +1,4 @@ -trait AnyTrait : Any +trait AnyTrait : Any class Foo : AnyTrait diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.kt b/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.kt index 518769eb384..78e8dd956e9 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/traitSupertypeList.kt @@ -1,9 +1,9 @@ open class bar() -trait Foo() : bar(), bar, bar { +trait Foo() : bar(), bar, bar { } -trait Foo2 : bar, Foo { +trait Foo2 : bar, Foo { } open class Foo1() : bar(), bar, Foo, Foo() {} diff --git a/compiler/testData/diagnostics/tests/traitWithRequired/uninheritableTraitDifferentGenericArguments.kt b/compiler/testData/diagnostics/tests/traitWithRequired/uninheritableTraitDifferentGenericArguments.kt index 56a6fc4e30e..3d6e92afd39 100644 --- a/compiler/testData/diagnostics/tests/traitWithRequired/uninheritableTraitDifferentGenericArguments.kt +++ b/compiler/testData/diagnostics/tests/traitWithRequired/uninheritableTraitDifferentGenericArguments.kt @@ -1,7 +1,7 @@ open class Generic -trait A : Generic +trait A : Generic -trait B : Generic +trait B : Generic trait C : A, B diff --git a/idea/testData/checker/SupertypeListChecks.kt b/idea/testData/checker/SupertypeListChecks.kt index 18ab8f86a19..da94dafbe48 100644 --- a/idea/testData/checker/SupertypeListChecks.kt +++ b/idea/testData/checker/SupertypeListChecks.kt @@ -24,11 +24,11 @@ trait T2 {} trait Test() { } -trait Test1 : C2() {} +trait Test1 : C2() {} -trait Test2 : C2 {} +trait Test2 : C2 {} -trait Test3 : C2, C3 {} +trait Test3 : C2, C3 {} trait Test4 : T1 {} diff --git a/idea/testData/checker/TraitSupertypeList.kt b/idea/testData/checker/TraitSupertypeList.kt index 107fbe5d82d..c39e318c9f6 100644 --- a/idea/testData/checker/TraitSupertypeList.kt +++ b/idea/testData/checker/TraitSupertypeList.kt @@ -1,9 +1,9 @@ open class bar() -trait Foo() : bar(), bar, bar { +trait Foo() : bar(), bar, bar { } -trait Foo2 : bar, Foo { +trait Foo2 : bar, Foo { } open class Foo1() : bar(), bar, Foo, Foo() {} diff --git a/idea/testData/checker/unmetTraitRequirements.kt b/idea/testData/checker/unmetTraitRequirements.kt index 4da6e136808..b692a9d41d3 100644 --- a/idea/testData/checker/unmetTraitRequirements.kt +++ b/idea/testData/checker/unmetTraitRequirements.kt @@ -1,14 +1,14 @@ open class Base { } -trait Derived: Base { +trait Derived: Base { fun foo() { f1(this@Derived) } } -class DerivedImpl(): Derived {} -object ObjectImpl: Derived {} +class DerivedImpl(): Derived {} +object ObjectImpl: Derived {} fun f1(b: Base) = b