Support platform/impl modifiers for classes

Do not report "unused parameter" for parameters of platform declarations. Do
not allow platform class constructors to have val/var parameters or have an
explicit delegation call to another constructor. Do not allow platform classes
to have 'init' blocks.

Also suppress the "supertype not initialized" error for platform classes: the
supertype should be initialized in the impl class
This commit is contained in:
Alexander Udalov
2016-10-28 11:22:35 +03:00
parent ce9691cd2b
commit 751949db69
21 changed files with 528 additions and 7 deletions
@@ -0,0 +1,7 @@
<!UNSUPPORTED_FEATURE!>platform<!> fun foo1()
<!UNSUPPORTED_FEATURE!>platform<!> val bar1 = <!PLATFORM_PROPERTY_INITIALIZER!>42<!>
<!UNSUPPORTED_FEATURE!>platform<!> class Baz1
<!UNSUPPORTED_FEATURE!>impl<!> fun foo2() = 42
<!MUST_BE_INITIALIZED!><!UNSUPPORTED_FEATURE!>impl<!> val bar2: Int<!>
<!UNSUPPORTED_FEATURE!>impl<!> interface Baz2
@@ -0,0 +1,10 @@
package
public val bar2: kotlin.Int
public impl fun foo2(): kotlin.Int
public impl interface Baz2 {
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
}