diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.kt index f60620a886d..ecf908d24e9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.kt @@ -93,17 +93,16 @@ public object ModifierCheckerCore { private val possibleParentTargetMap = mapOf>( INNER_KEYWORD to EnumSet.of(CLASS_ONLY, INNER_CLASS, LOCAL_CLASS, ENUM_CLASS, ENUM_ENTRY), OVERRIDE_KEYWORD to EnumSet.of(CLASS, ENUM_ENTRY), - PROTECTED_KEYWORD to EnumSet.of(CLASS_ONLY, INNER_CLASS, LOCAL_CLASS, ENUM_CLASS, INTERFACE, OBJECT), + PROTECTED_KEYWORD to EnumSet.of(CLASS_ONLY, INNER_CLASS, LOCAL_CLASS, ENUM_CLASS, OBJECT), + INTERNAL_KEYWORD to EnumSet.of(CLASS_ONLY, INNER_CLASS, LOCAL_CLASS, OBJECT, OBJECT_LITERAL, + ANNOTATION_CLASS, ENUM_CLASS, ENUM_ENTRY, FILE), COMPANION_KEYWORD to EnumSet.of(CLASS_ONLY, ENUM_CLASS, INTERFACE) ) private val deprecatedParentTargetMap = mapOf>( - // Deprecated in M14, forbidden in M15 - INTERNAL_KEYWORD to EnumSet.of(INTERFACE), - PROTECTED_KEYWORD to EnumSet.of(INTERFACE, OBJECT), // Deprecated in M15 - FINAL_KEYWORD to EnumSet.of(INTERFACE) - //PROTECTED_KEYWORD to EnumSet.of(OBJECT) + FINAL_KEYWORD to EnumSet.of(INTERFACE), + PROTECTED_KEYWORD to EnumSet.of(OBJECT) ) // First modifier in pair should be also first in declaration diff --git a/compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.out b/compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.out index ea764f7d861..52aee497d75 100644 --- a/compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.out +++ b/compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.out @@ -4,7 +4,7 @@ compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.kt:6:5: error: mo compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.kt:6:14: error: cannot weaken access privilege 'public' for 'c' in 'A' override protected private val c: Int ^ -compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.kt:6:14: error: modifier 'protected' is incompatible with 'private' +compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.kt:6:14: error: modifier 'protected' is not applicable inside 'interface' override protected private val c: Int ^ compiler/testData/cli/jvm/multipleTextRangesInDiagnosticsOrder.kt:6:24: error: modifier 'private' is incompatible with 'override' diff --git a/compiler/testData/codegen/box/classes/kt2477.kt b/compiler/testData/codegen/box/classes/kt2477.kt index bd449eefb43..dcac7569a1a 100644 --- a/compiler/testData/codegen/box/classes/kt2477.kt +++ b/compiler/testData/codegen/box/classes/kt2477.kt @@ -6,11 +6,12 @@ interface A { } interface B { - protected val c: String + private val c: String + get() = "FAIL" } -open class C { - private val c: String = "FAIL" +abstract class C { + abstract protected val c: String } open class D: C(), A, B { diff --git a/compiler/testData/codegen/box/traits/inheritProtectedInterfaceMembers.kt b/compiler/testData/codegen/box/traits/inheritProtectedInterfaceMembers.kt deleted file mode 100644 index 7c9a21dce3b..00000000000 --- a/compiler/testData/codegen/box/traits/inheritProtectedInterfaceMembers.kt +++ /dev/null @@ -1,30 +0,0 @@ -interface A { - protected fun foo() - - protected fun fooImpl() { } - - protected var bar: Int - - public var baz: String - public get() = "" - protected set(value) {} - - fun test(): String { - foo() - fooImpl() - bar = bar + 1 - baz = baz + "1" - return "OK" - } -} - -class B : A { - protected override fun foo() {} - - protected override var bar: Int = 42 - - override var baz: String = "" - protected set -} - -fun box() = B().test() diff --git a/compiler/testData/codegen/box/traits/protectedClassInInterface.kt b/compiler/testData/codegen/box/traits/protectedClassInInterface.kt deleted file mode 100644 index 9ca4ffb4e68..00000000000 --- a/compiler/testData/codegen/box/traits/protectedClassInInterface.kt +++ /dev/null @@ -1,11 +0,0 @@ -interface Foo { - protected class Bar { - fun box() = "OK" - } -} - -class Baz : Foo { - fun box() = Foo.Bar().box() -} - -fun box() = Baz().box() diff --git a/compiler/testData/codegen/box/traits/protectedFunDiamond.kt b/compiler/testData/codegen/box/traits/protectedFunDiamond.kt deleted file mode 100644 index 6a75f82fc3d..00000000000 --- a/compiler/testData/codegen/box/traits/protectedFunDiamond.kt +++ /dev/null @@ -1,15 +0,0 @@ -interface A { - protected fun foo(): String - - fun box() = foo() -} - -interface B : A - -interface C : A { - protected override fun foo() = "OK" -} - -class D : B, C - -fun box() = D().box() diff --git a/compiler/testData/diagnostics/tests/modifiers/internalInInterface.kt b/compiler/testData/diagnostics/tests/modifiers/internalInInterface.kt new file mode 100644 index 00000000000..144a361742f --- /dev/null +++ b/compiler/testData/diagnostics/tests/modifiers/internalInInterface.kt @@ -0,0 +1,7 @@ +interface My { + internal val x: Int + internal val xxx: Int + get() = 0 + internal fun foo(): Int + internal fun bar() = 42 +} diff --git a/compiler/testData/diagnostics/tests/modifiers/internalInInterface.txt b/compiler/testData/diagnostics/tests/modifiers/internalInInterface.txt new file mode 100644 index 00000000000..62a94b03fd8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/modifiers/internalInInterface.txt @@ -0,0 +1,11 @@ +package + +public interface My { + internal abstract val x: kotlin.Int + internal open val xxx: kotlin.Int + internal open fun bar(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + internal abstract fun foo(): 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/modifiers/protected.kt b/compiler/testData/diagnostics/tests/modifiers/protected.kt index 16b43390534..3b493ae320e 100644 --- a/compiler/testData/diagnostics/tests/modifiers/protected.kt +++ b/compiler/testData/diagnostics/tests/modifiers/protected.kt @@ -17,5 +17,5 @@ enum class Our(protected val x: Int) { } interface Their { - protected fun foo() = 7 + protected fun foo() = 7 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.kt b/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.kt deleted file mode 100644 index 3cdaf523ff4..00000000000 --- a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.kt +++ /dev/null @@ -1,13 +0,0 @@ -interface T { - internal var foo: Long -} - -interface U { - protected var foo: Long -} - -interface V : T, U { - override var foo: Long -} - -interface W : T, U diff --git a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.txt b/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.txt deleted file mode 100644 index 7d526486357..00000000000 --- a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.txt +++ /dev/null @@ -1,29 +0,0 @@ -package - -public interface T { - internal abstract var foo: kotlin.Long - 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 U { - protected abstract var foo: kotlin.Long - 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 V : T, U { - public abstract override /*2*/ var foo: kotlin.Long - 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 -} - -public interface W : T, U { - public abstract override /*2*/ /*fake_override*/ var foo: kotlin.Long - 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 -} diff --git a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.kt b/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.kt deleted file mode 100644 index e07cc06807d..00000000000 --- a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.kt +++ /dev/null @@ -1,13 +0,0 @@ -interface T { - public var foo: Short - internal set -} - -interface U { - public var foo: Short - protected set -} - -interface V : T, U { - override var foo: Short -} diff --git a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.txt b/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.txt deleted file mode 100644 index 23e0c612b80..00000000000 --- a/compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.txt +++ /dev/null @@ -1,22 +0,0 @@ -package - -public interface T { - public abstract var foo: kotlin.Short - 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 U { - public abstract var foo: kotlin.Short - 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 V : T, U { - public abstract override /*2*/ var foo: kotlin.Short - 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 -} diff --git a/compiler/testData/diagnostics/tests/scopes/kt1822.kt b/compiler/testData/diagnostics/tests/scopes/kt1822.kt index b6857aa1b81..def507adb86 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1822.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1822.kt @@ -6,7 +6,7 @@ open class C { } interface T { - protected fun foo() {} + protected fun foo() {} } class G : C(), T { @@ -18,7 +18,7 @@ open class A { } interface B { - protected fun foo() {} + protected fun foo() {} } interface D { diff --git a/compiler/testData/diagnostics/tests/variance/Visibility.kt b/compiler/testData/diagnostics/tests/variance/Visibility.kt index 58798cb72f9..d416983bd7e 100644 --- a/compiler/testData/diagnostics/tests/variance/Visibility.kt +++ b/compiler/testData/diagnostics/tests/variance/Visibility.kt @@ -1,20 +1,20 @@ interface Test { val internal_val: I public val public_val: I - protected val protected_val: I + protected val protected_val: I private val private_val: I var interlan_private_set: O private set public var public_private_set: O private set - protected var protected_private_set: O + protected var protected_private_set: O private set private var private_private_set: O private set fun internal_fun(i: O) : I public fun public_fun(i: O) : I - protected fun protected_fun(i: O) : I + protected fun protected_fun(i: O) : I private fun private_fun(i: O) : I } \ No newline at end of file diff --git a/compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.kt b/compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.kt deleted file mode 100644 index fb1e41fbbdb..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.kt +++ /dev/null @@ -1,14 +0,0 @@ -//ALLOW_AST_ACCESS -package test - -interface A { - internal fun f() : Int - internal val v : Int - public var p : Int -} - -class B : A { - override fun f(): Int = throw UnsupportedOperationException() - public override var p: Int = 0 - override val v: Int = 0 -} diff --git a/compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.txt b/compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.txt deleted file mode 100644 index a5b85d75caa..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.txt +++ /dev/null @@ -1,20 +0,0 @@ -package test - -public interface A { - public abstract var p: kotlin.Int - public abstract fun (): kotlin.Int - public abstract fun (/*0*/ : kotlin.Int): kotlin.Unit - internal abstract val v: kotlin.Int - internal abstract fun (): kotlin.Int - internal abstract fun f(): kotlin.Int -} - -public final class B : test.A { - /*primary*/ public constructor B() - public open override /*1*/ var p: kotlin.Int - public open override /*1*/ fun (): kotlin.Int - public open override /*1*/ fun (/*0*/ : kotlin.Int): kotlin.Unit - internal open override /*1*/ val v: kotlin.Int = 0 - internal open override /*1*/ fun (): kotlin.Int - internal open override /*1*/ fun f(): kotlin.Int -} diff --git a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.kt b/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.kt deleted file mode 100644 index 79f342af7df..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.kt +++ /dev/null @@ -1,8 +0,0 @@ -package test - -interface A { - internal fun f() : Int - internal val v : Int - public var p : Int - internal set -} diff --git a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.txt b/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.txt deleted file mode 100644 index fc552e46459..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.txt +++ /dev/null @@ -1,10 +0,0 @@ -package test - -public interface A { - public abstract var p: kotlin.Int - public abstract fun (): kotlin.Int - internal abstract fun (/*0*/ : kotlin.Int): kotlin.Unit - internal abstract val v: kotlin.Int - internal abstract fun (): kotlin.Int - internal abstract fun f(): kotlin.Int -} diff --git a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.kt b/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.kt deleted file mode 100644 index 6ebb066ee81..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.kt +++ /dev/null @@ -1,14 +0,0 @@ -package test - -interface A { - internal open fun f() : Int = 0 - internal open val v : Int - get() = 0 - public var p : Int - get() = 5 - internal set(value) { - } -} - -class B : A { -} diff --git a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.txt b/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.txt deleted file mode 100644 index eee7cbf1335..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.txt +++ /dev/null @@ -1,20 +0,0 @@ -package test - -public interface A { - public open var p: kotlin.Int - public open fun (): kotlin.Int - internal open fun (/*0*/ value: kotlin.Int): kotlin.Unit - internal open val v: kotlin.Int - internal open fun (): kotlin.Int - internal open fun f(): kotlin.Int -} - -public final class B : test.A { - /*primary*/ public constructor B() - public open override /*1*/ /*fake_override*/ var p: kotlin.Int - public open override /*1*/ /*fake_override*/ fun (): kotlin.Int - internal open override /*1*/ /*fake_override*/ fun (/*0*/ value: kotlin.Int): kotlin.Unit - internal open override /*1*/ /*fake_override*/ val v: kotlin.Int - internal open override /*1*/ /*fake_override*/ fun (): kotlin.Int - internal open override /*1*/ /*fake_override*/ fun f(): kotlin.Int -} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index 9d13845ed01..aa10a7ed10a 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -9174,6 +9174,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("internalInInterface.kt") + public void testInternalInInterface() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/modifiers/internalInInterface.kt"); + doTest(fileName); + } + @TestMetadata("NoLocalVisibility.kt") public void testNoLocalVisibility() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/modifiers/NoLocalVisibility.kt"); @@ -10236,18 +10242,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } - @TestMetadata("CannotInferVisibilityForProperty.kt") - public void testCannotInferVisibilityForProperty() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/CannotInferVisibilityForProperty.kt"); - doTest(fileName); - } - - @TestMetadata("CannotInferVisibilityForPropertySetter.kt") - public void testCannotInferVisibilityForPropertySetter() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/CannotInferVisibilityForPropertySetter.kt"); - doTest(fileName); - } - @TestMetadata("ComplexValRedeclaration.kt") public void testComplexValRedeclaration() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/override/ComplexValRedeclaration.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java index 4badb87abaf..44b9d616cb2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxCodegenTestGenerated.java @@ -7552,12 +7552,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } - @TestMetadata("inheritProtectedInterfaceMembers.kt") - public void testInheritProtectedInterfaceMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/traits/inheritProtectedInterfaceMembers.kt"); - doTest(fileName); - } - @TestMetadata("inheritedFun.kt") public void testInheritedFun() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/traits/inheritedFun.kt"); @@ -7654,18 +7648,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } - @TestMetadata("protectedClassInInterface.kt") - public void testProtectedClassInInterface() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/traits/protectedClassInInterface.kt"); - doTest(fileName); - } - - @TestMetadata("protectedFunDiamond.kt") - public void testProtectedFunDiamond() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/traits/protectedFunDiamond.kt"); - doTest(fileName); - } - @TestMetadata("traitImplDelegationWithCovariantOverride.kt") public void testTraitImplDelegationWithCovariantOverride() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/traits/traitImplDelegationWithCovariantOverride.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java index bc3a2544d35..90c16ea6b56 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java @@ -4924,12 +4924,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/visibility"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("InternalAbstractTraitMembersOverridden.kt") - public void testInternalAbstractTraitMembersOverridden() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); - doTestCompiledKotlin(fileName); - } - @TestMetadata("InternalClass.kt") public void testInternalClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalClass.kt"); @@ -4948,18 +4942,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { doTestCompiledKotlin(fileName); } - @TestMetadata("InternalTraitMembers.kt") - public void testInternalTraitMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.kt"); - doTestCompiledKotlin(fileName); - } - - @TestMetadata("InternalTraitMembersInherited.kt") - public void testInternalTraitMembersInherited() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.kt"); - doTestCompiledKotlin(fileName); - } - @TestMetadata("PrivateClass.kt") public void testPrivateClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateClass.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java index 376dc79ce4c..d8e2dc6c9b1 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java @@ -3033,12 +3033,6 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/visibility"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("InternalAbstractTraitMembersOverridden.kt") - public void testInternalAbstractTraitMembersOverridden() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); - doTest(fileName); - } - @TestMetadata("InternalClass.kt") public void testInternalClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalClass.kt"); @@ -3057,18 +3051,6 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD doTest(fileName); } - @TestMetadata("InternalTraitMembers.kt") - public void testInternalTraitMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.kt"); - doTest(fileName); - } - - @TestMetadata("InternalTraitMembersInherited.kt") - public void testInternalTraitMembersInherited() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.kt"); - doTest(fileName); - } - @TestMetadata("PrivateClass.kt") public void testPrivateClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateClass.kt"); diff --git a/idea/testData/codeInsight/overrideImplement/inheritVisibilities.kt b/idea/testData/codeInsight/overrideImplement/inheritVisibilities.kt deleted file mode 100644 index 1e422a7f8f8..00000000000 --- a/idea/testData/codeInsight/overrideImplement/inheritVisibilities.kt +++ /dev/null @@ -1,15 +0,0 @@ -open class A() { - protected open fun protectedFun() { } - internal open fun internalFun() {} - public open fun publicFun() {} -} - -interface B { - protected open val protectedProperty : Int - internal open val internalProperty : Int - public open val publicProperty : Int -} - -class C : A(), B { - -} diff --git a/idea/testData/codeInsight/overrideImplement/inheritVisibilities.kt.after b/idea/testData/codeInsight/overrideImplement/inheritVisibilities.kt.after deleted file mode 100644 index 1e154b9f4f3..00000000000 --- a/idea/testData/codeInsight/overrideImplement/inheritVisibilities.kt.after +++ /dev/null @@ -1,46 +0,0 @@ -open class A() { - protected open fun protectedFun() { } - internal open fun internalFun() {} - public open fun publicFun() {} -} - -interface B { - protected open val protectedProperty : Int - internal open val internalProperty : Int - public open val publicProperty : Int -} - -class C : A(), B { - override fun equals(other: Any?): Boolean { - return super.equals(other) - } - - override fun hashCode(): Int { - return super.hashCode() - } - - override fun internalFun() { - super.internalFun() - } - - override val internalProperty: Int - get() = throw UnsupportedOperationException() - - override fun protectedFun() { - super.protectedFun() - } - - override val protectedProperty: Int - get() = throw UnsupportedOperationException() - - override fun publicFun() { - super.publicFun() - } - - override val publicProperty: Int - get() = throw UnsupportedOperationException() - - override fun toString(): String { - return super.toString() - } -} diff --git a/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt b/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt index 7cea47dc0bd..586e785b21c 100644 --- a/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt +++ b/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt @@ -1,6 +1,6 @@ interface Test { public open fun test() - protected open val testProp : Int + public open val testProp : Int } class SomeTest : Test { diff --git a/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt.after b/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt.after index f1a81bf3cc1..47e356d38f7 100644 --- a/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt.after +++ b/idea/testData/codeInsight/overrideImplement/respectCaretPosition.kt.after @@ -1,6 +1,6 @@ interface Test { public open fun test() - protected open val testProp : Int + public open val testProp : Int } class SomeTest : Test { diff --git a/idea/testData/intentions/changeVisibility/protected/notForInternalOverride.kt b/idea/testData/intentions/changeVisibility/protected/notForInternalOverride.kt deleted file mode 100644 index 23038d66ee2..00000000000 --- a/idea/testData/intentions/changeVisibility/protected/notForInternalOverride.kt +++ /dev/null @@ -1,8 +0,0 @@ -// IS_APPLICABLE: false -interface I { - internal fun foo() -} - -abstract class C : I { - override fun foo() {} -} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt b/idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt deleted file mode 100644 index 0ce3e6eb6b6..00000000000 --- a/idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt +++ /dev/null @@ -1,7 +0,0 @@ -interface I { - protected fun foo() -} - -abstract class C : I { - public override fun foo() {} -} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt.after b/idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt.after deleted file mode 100644 index 59b5c45792c..00000000000 --- a/idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt.after +++ /dev/null @@ -1,7 +0,0 @@ -interface I { - protected fun foo() -} - -abstract class C : I { - override fun foo() {} -} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/forOverride.kt b/idea/testData/intentions/changeVisibility/public/forOverride.kt deleted file mode 100644 index 75bf7e4e600..00000000000 --- a/idea/testData/intentions/changeVisibility/public/forOverride.kt +++ /dev/null @@ -1,7 +0,0 @@ -interface I { - protected fun foo() -} - -abstract class C : I { - protected override fun foo() {} -} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/forOverride.kt.after b/idea/testData/intentions/changeVisibility/public/forOverride.kt.after deleted file mode 100644 index 0ce3e6eb6b6..00000000000 --- a/idea/testData/intentions/changeVisibility/public/forOverride.kt.after +++ /dev/null @@ -1,7 +0,0 @@ -interface I { - protected fun foo() -} - -abstract class C : I { - public override fun foo() {} -} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/forOverride2.kt b/idea/testData/intentions/changeVisibility/public/forOverride2.kt deleted file mode 100644 index 59b5c45792c..00000000000 --- a/idea/testData/intentions/changeVisibility/public/forOverride2.kt +++ /dev/null @@ -1,7 +0,0 @@ -interface I { - protected fun foo() -} - -abstract class C : I { - override fun foo() {} -} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/public/forOverride2.kt.after b/idea/testData/intentions/changeVisibility/public/forOverride2.kt.after deleted file mode 100644 index 0ce3e6eb6b6..00000000000 --- a/idea/testData/intentions/changeVisibility/public/forOverride2.kt.after +++ /dev/null @@ -1,7 +0,0 @@ -interface I { - protected fun foo() -} - -abstract class C : I { - public override fun foo() {} -} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/OverrideImplementTest.kt b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/OverrideImplementTest.kt index 14a1d2e4b1f..21e510be184 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/OverrideImplementTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/OverrideImplementTest.kt @@ -152,10 +152,6 @@ public class OverrideImplementTest : AbstractOverrideImplementTest() { doMultiOverrideDirectoryTest() } - public fun testInheritVisibilities() { - doMultiOverrideFileTest() - } - public fun testImplementSamAdapters() { doImplementDirectoryTest() } diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index 31def66de34..08b20cc17fe 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -2291,12 +2291,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } - @TestMetadata("notForInternalOverride.kt") - public void testNotForInternalOverride() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/protected/notForInternalOverride.kt"); - doTest(fileName); - } - @TestMetadata("notForObjectMember.kt") public void testNotForObjectMember() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/protected/notForObjectMember.kt"); @@ -2315,12 +2309,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } - @TestMetadata("overrideVisibilityToDefault.kt") - public void testOverrideVisibilityToDefault() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/protected/overrideVisibilityToDefault.kt"); - doTest(fileName); - } - @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/protected/simple.kt"); @@ -2342,18 +2330,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } - @TestMetadata("forOverride.kt") - public void testForOverride() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/forOverride.kt"); - doTest(fileName); - } - - @TestMetadata("forOverride2.kt") - public void testForOverride2() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/forOverride2.kt"); - doTest(fileName); - } - @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/primaryConstructor.kt"); diff --git a/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java index df6bd965994..2090749ec6c 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java @@ -3031,12 +3031,6 @@ public class ResolveByStubTestGenerated extends AbstractResolveByStubTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/visibility"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("InternalAbstractTraitMembersOverridden.kt") - public void testInternalAbstractTraitMembersOverridden() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); - doTest(fileName); - } - @TestMetadata("InternalClass.kt") public void testInternalClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalClass.kt"); @@ -3055,18 +3049,6 @@ public class ResolveByStubTestGenerated extends AbstractResolveByStubTest { doTest(fileName); } - @TestMetadata("InternalTraitMembers.kt") - public void testInternalTraitMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembers.kt"); - doTest(fileName); - } - - @TestMetadata("InternalTraitMembersInherited.kt") - public void testInternalTraitMembersInherited() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/InternalTraitMembersInherited.kt"); - doTest(fileName); - } - @TestMetadata("PrivateClass.kt") public void testPrivateClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/visibility/PrivateClass.kt"); diff --git a/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt b/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt index 684585d863c..63e8b4b656f 100644 --- a/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt +++ b/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt @@ -7,12 +7,12 @@ package test internal interface InlineTrait { - internal inline final fun finalInline(s: () -> String): String { + public inline final fun finalInline(s: () -> String): String { return s() } companion object { - internal inline final fun finalInline(s: () -> String): String { + public inline final fun finalInline(s: () -> String): String { return s() } }