'final' is deprecated in interfaces

This commit is contained in:
Mikhail Glukhikh
2015-09-28 12:36:36 +03:00
parent a55f9feacb
commit 7cf2840fe5
5 changed files with 10 additions and 13 deletions
@@ -85,8 +85,11 @@ public object ModifierCheckerCore {
) )
private val deprecatedParentTargetMap = mapOf<JetModifierKeywordToken, Set<KotlinTarget>>( private val deprecatedParentTargetMap = mapOf<JetModifierKeywordToken, Set<KotlinTarget>>(
// Deprecated in M14, forbidden in M15
INTERNAL_KEYWORD to EnumSet.of(INTERFACE), INTERNAL_KEYWORD to EnumSet.of(INTERFACE),
PROTECTED_KEYWORD to EnumSet.of(INTERFACE) PROTECTED_KEYWORD to EnumSet.of(INTERFACE),
// Deprecated in M15
FINAL_KEYWORD to EnumSet.of(INTERFACE)
) )
// First modifier in pair should be also first in declaration // First modifier in pair should be also first in declaration
@@ -1,5 +1,5 @@
interface T { interface T {
final fun component1(): Int = 42 <!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>final<!> fun component1(): Int = 42
} }
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class A(val x: Int) : T <!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class A(val x: Int) : T
@@ -2,14 +2,14 @@
package a package a
interface T { interface T {
<!FINAL_FUNCTION_WITH_NO_BODY!>final<!> fun foo() <!FINAL_FUNCTION_WITH_NO_BODY, DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>final<!> fun foo()
<!FINAL_PROPERTY_IN_TRAIT!>final<!> val b : Int <!FINAL_PROPERTY_IN_TRAIT, DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>final<!> val b : Int
final fun bar() {} <!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>final<!> fun bar() {}
final val c : Int <!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>final<!> val c : Int
get() = 42 get() = 42
final val d = <!PROPERTY_INITIALIZER_IN_TRAIT!>1<!> <!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>final<!> val d = <!PROPERTY_INITIALIZER_IN_TRAIT!>1<!>
} }
class A { class A {
@@ -30,9 +30,6 @@ abstract class A {
interface B { interface B {
inline private fun good1() {} inline private fun good1() {}
inline public final fun good2() {}
inline final fun good3() {}
inline final fun good4() {}
<!DECLARATION_CANT_BE_INLINED!>inline fun wrong1() {}<!> <!DECLARATION_CANT_BE_INLINED!>inline fun wrong1() {}<!>
@@ -24,9 +24,6 @@ public abstract class A {
public interface B { public interface B {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@kotlin.inline() private final fun good1(): kotlin.Unit @kotlin.inline() private final fun good1(): kotlin.Unit
@kotlin.inline() public final fun good2(): kotlin.Unit
@kotlin.inline() public final fun good3(): kotlin.Unit
@kotlin.inline() public final fun good4(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@kotlin.inline() public open fun wrong1(): kotlin.Unit @kotlin.inline() public open fun wrong1(): kotlin.Unit