protected & internal are now forbidden in interfaces
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5f43628f1b
commit
cba6870f52
@@ -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 {
|
||||
<caret>
|
||||
}
|
||||
@@ -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 {
|
||||
<selection><caret>return super.equals(other)</selection>
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
interface Test {
|
||||
public open fun test()
|
||||
protected open val testProp : Int
|
||||
public open val testProp : Int
|
||||
}
|
||||
|
||||
class SomeTest : Test {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
interface Test {
|
||||
public open fun test()
|
||||
protected open val testProp : Int
|
||||
public open val testProp : Int
|
||||
}
|
||||
|
||||
class SomeTest : Test {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
interface I {
|
||||
internal fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>override fun foo() {}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
interface I {
|
||||
protected fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>public override fun foo() {}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
interface I {
|
||||
protected fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>override fun foo() {}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
interface I {
|
||||
protected fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>protected override fun foo() {}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
interface I {
|
||||
protected fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>public override fun foo() {}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
interface I {
|
||||
protected fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>override fun foo() {}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
interface I {
|
||||
protected fun foo()
|
||||
}
|
||||
|
||||
abstract class C : I {
|
||||
<caret>public override fun foo() {}
|
||||
}
|
||||
@@ -152,10 +152,6 @@ public class OverrideImplementTest : AbstractOverrideImplementTest() {
|
||||
doMultiOverrideDirectoryTest()
|
||||
}
|
||||
|
||||
public fun testInheritVisibilities() {
|
||||
doMultiOverrideFileTest()
|
||||
}
|
||||
|
||||
public fun testImplementSamAdapters() {
|
||||
doImplementDirectoryTest()
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user