Report error on native declaration with a body

This commit is contained in:
Andrey Breslav
2014-12-01 15:49:05 +03:00
parent d4cf789b53
commit a94a1f8a6f
8 changed files with 79 additions and 5 deletions
@@ -0,0 +1,25 @@
import kotlin.jvm.*
<!NATIVE_DECLARATION_CANNOT_HAVE_BODY!>native fun foo()<!> {}
class C {
<!NATIVE_DECLARATION_CANNOT_HAVE_BODY!>native fun foo()<!> {}
class object {
<!NATIVE_DECLARATION_CANNOT_HAVE_BODY!>native fun foo()<!> {}
}
}
object O {
<!NATIVE_DECLARATION_CANNOT_HAVE_BODY!>native fun foo()<!> {}
}
fun test() {
class Local {
<!NATIVE_DECLARATION_CANNOT_HAVE_BODY!>native fun foo()<!> {}
}
object {
<!NATIVE_DECLARATION_CANNOT_HAVE_BODY!>native fun foo()<!> {}
}
}
@@ -0,0 +1,36 @@
package
kotlin.jvm.native() internal fun foo(): kotlin.Unit
internal fun test(): kotlin.Unit
internal final class C {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.jvm.native() internal final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal class object <class-object-for-C> {
private constructor <class-object-for-C>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.jvm.native() internal final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
internal object O {
private constructor O()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.jvm.native() internal final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public class object <class-object-for-O> : O {
private constructor <class-object-for-O>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.jvm.native() internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}