protected & internal are now forbidden in interfaces
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5f43628f1b
commit
cba6870f52
@@ -93,17 +93,16 @@ public object ModifierCheckerCore {
|
||||
private val possibleParentTargetMap = mapOf<JetModifierKeywordToken, Set<KotlinTarget>>(
|
||||
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<JetModifierKeywordToken, Set<KotlinTarget>>(
|
||||
// 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
|
||||
|
||||
@@ -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'
|
||||
|
||||
+4
-3
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
@@ -1,11 +0,0 @@
|
||||
interface Foo {
|
||||
protected class Bar {
|
||||
fun box() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
class Baz : Foo {
|
||||
fun box() = Foo.Bar().box()
|
||||
}
|
||||
|
||||
fun box() = Baz().box()
|
||||
@@ -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()
|
||||
@@ -0,0 +1,7 @@
|
||||
interface My {
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> val x: Int
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> val xxx: Int
|
||||
get() = 0
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> fun foo(): Int
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> fun bar() = 42
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -17,5 +17,5 @@ enum class Our(protected val x: Int) {
|
||||
}
|
||||
|
||||
interface Their {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 7
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 7
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
interface T {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>internal<!> var foo: Long
|
||||
}
|
||||
|
||||
interface U {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> var foo: Long
|
||||
}
|
||||
|
||||
interface V : T, U {
|
||||
<!CANNOT_INFER_VISIBILITY!>override var foo: Long<!>
|
||||
}
|
||||
|
||||
interface <!CANNOT_INFER_VISIBILITY!>W<!> : T, U
|
||||
-29
@@ -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
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
interface T {
|
||||
public var foo: Short
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>internal<!> set
|
||||
}
|
||||
|
||||
interface U {
|
||||
public var foo: Short
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> set
|
||||
}
|
||||
|
||||
interface V : T, U {
|
||||
<!CANNOT_INFER_VISIBILITY!>override var foo: Short<!>
|
||||
}
|
||||
-22
@@ -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
|
||||
}
|
||||
+2
-2
@@ -6,7 +6,7 @@ open class C {
|
||||
}
|
||||
|
||||
interface T {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
}
|
||||
|
||||
class G : C(), T {
|
||||
@@ -18,7 +18,7 @@ open class A {
|
||||
}
|
||||
|
||||
interface B {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
}
|
||||
|
||||
interface D {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
interface Test<in I, out O> {
|
||||
val internal_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
public val public_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> val protected_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> val protected_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!PRIVATE_PROPERTY_IN_INTERFACE!>private<!> val private_val: I
|
||||
|
||||
var interlan_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
private set
|
||||
public var public_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
private set
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> var protected_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> var protected_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
private set
|
||||
<!PRIVATE_PROPERTY_IN_INTERFACE!>private<!> var private_private_set: O
|
||||
private set
|
||||
|
||||
fun internal_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
public fun public_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun protected_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun protected_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!PRIVATE_FUNCTION_WITH_NO_BODY!>private<!> fun private_fun(i: O) : I
|
||||
}
|
||||
Vendored
-14
@@ -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
|
||||
}
|
||||
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
package test
|
||||
|
||||
public interface A {
|
||||
public abstract var p: kotlin.Int
|
||||
public abstract fun <get-p>(): kotlin.Int
|
||||
public abstract fun <set-p>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
|
||||
internal abstract val v: kotlin.Int
|
||||
internal abstract fun <get-v>(): 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 <get-p>(): kotlin.Int
|
||||
public open override /*1*/ fun <set-p>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
|
||||
internal open override /*1*/ val v: kotlin.Int = 0
|
||||
internal open override /*1*/ fun <get-v>(): kotlin.Int
|
||||
internal open override /*1*/ fun f(): kotlin.Int
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package test
|
||||
|
||||
interface A {
|
||||
internal fun f() : Int
|
||||
internal val v : Int
|
||||
public var p : Int
|
||||
internal set
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package test
|
||||
|
||||
public interface A {
|
||||
public abstract var p: kotlin.Int
|
||||
public abstract fun <get-p>(): kotlin.Int
|
||||
internal abstract fun <set-p>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
|
||||
internal abstract val v: kotlin.Int
|
||||
internal abstract fun <get-v>(): kotlin.Int
|
||||
internal abstract fun f(): kotlin.Int
|
||||
}
|
||||
-14
@@ -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 {
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package test
|
||||
|
||||
public interface A {
|
||||
public open var p: kotlin.Int
|
||||
public open fun <get-p>(): kotlin.Int
|
||||
internal open fun <set-p>(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
internal open val v: kotlin.Int
|
||||
internal open fun <get-v>(): 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 <get-p>(): kotlin.Int
|
||||
internal open override /*1*/ /*fake_override*/ fun <set-p>(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
internal open override /*1*/ /*fake_override*/ val v: kotlin.Int
|
||||
internal open override /*1*/ /*fake_override*/ fun <get-v>(): kotlin.Int
|
||||
internal open override /*1*/ /*fake_override*/ fun f(): kotlin.Int
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
-18
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
-18
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user