Report illegal modifiers and annotations on primary constructor

#KT-7057 Fixed
 #KT-6772 Fixed
This commit is contained in:
Denis Zharkov
2015-03-30 18:34:02 +03:00
parent 717f850470
commit 99f1ab333e
11 changed files with 82 additions and 9 deletions
@@ -135,3 +135,20 @@ class IllegalModifiers9 {
<!INCOMPATIBLE_MODIFIERS!>private<!> <!INCOMPATIBLE_MODIFIERS!>protected<!> constructor() {}
<!INCOMPATIBLE_MODIFIERS!>private<!> <!INCOMPATIBLE_MODIFIERS!>internal<!> constructor(<!UNUSED_PARAMETER!>x<!>: Int) {}
}
// Illegal modifiers on primary constructor
class IllegalModifiers10
<!ILLEGAL_MODIFIER, INCOMPATIBLE_MODIFIERS!>abstract<!>
<!ILLEGAL_ENUM_ANNOTATION!>enum<!>
<!ILLEGAL_MODIFIER, REDUNDANT_MODIFIER, REDUNDANT_MODIFIER, INCOMPATIBLE_MODIFIERS!>open<!>
<!ILLEGAL_MODIFIER!>inner<!>
<!ILLEGAL_ANNOTATION_KEYWORD!>annotation<!>
<!ILLEGAL_MODIFIER!>override<!>
<!ILLEGAL_MODIFIER!>out<!>
<!ILLEGAL_MODIFIER!>in<!>
<!ILLEGAL_MODIFIER, INCOMPATIBLE_MODIFIERS!>final<!>
<!ILLEGAL_MODIFIER!>vararg<!>
<!ILLEGAL_MODIFIER!>reified<!> ()
class IllegalModifiers11 <!INCOMPATIBLE_MODIFIERS!>private<!> <!INCOMPATIBLE_MODIFIERS!>protected<!> ()
@@ -44,6 +44,20 @@ package illegal_modifiers {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal final class IllegalModifiers10 {
public constructor IllegalModifiers10()
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 final class IllegalModifiers11 {
private constructor IllegalModifiers11()
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 final class IllegalModifiers2 {
public constructor IllegalModifiers2(/*0*/ a: kotlin.Int)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -32,7 +32,7 @@ var vardef: Int = 1
set
[<!INAPPLICABLE_ANNOTATION!>platformName("C")<!>]
class C [platformName("primary")]() { // TODO: modifiers check on primary constructor KT-7057
class C [<!INAPPLICABLE_ANNOTATION!>platformName("primary")<!>]() {
<!INAPPLICABLE_ANNOTATION!>platformName("ctr")<!> constructor(x: Int): this() {}
[<!INAPPLICABLE_ANNOTATION!>platformName("a")<!>]
fun foo() {}
@@ -6,4 +6,4 @@ class A {
}
}
class C [platformStatic] () // TODO KT-7057
class C <!PLATFORM_STATIC_ILLEGAL_USAGE!>[platformStatic] ()<!>
@@ -7,4 +7,4 @@ class A {
<!INAPPLICABLE_ANNOTATION!>native constructor(<!UNUSED_PARAMETER!>x<!>: Int)
<!>}
class C [native] () // TODO KT-7057
class C <!INAPPLICABLE_ANNOTATION!>[native]()<!>