JS: prohibit inline external declarations. See KT-15307

This commit is contained in:
Alexey Andreev
2016-12-19 14:06:14 +03:00
parent 84f094c770
commit 403753f5b5
7 changed files with 49 additions and 1 deletions
@@ -0,0 +1,19 @@
// !DIAGNOSTICS: -NOTHING_TO_INLINE
<!INLINE_EXTERNAL_DECLARATION!>inline external fun foo(): Unit<!>
inline external val bar: Int
<!INLINE_EXTERNAL_DECLARATION!>get()<!> = noImpl
external val baz: Int
<!INLINE_EXTERNAL_DECLARATION!>inline get()<!> = noImpl
external class A {
<!INLINE_EXTERNAL_DECLARATION!>inline fun foo(): Unit<!>
inline val bar: Int
<!INLINE_EXTERNAL_DECLARATION!>get()<!> = noImpl
val baz: Int
<!INLINE_EXTERNAL_DECLARATION!>inline get()<!> = noImpl
}
@@ -0,0 +1,15 @@
package
public external val bar: kotlin.Int
public external val baz: kotlin.Int
public external inline fun foo(): kotlin.Unit
public external final class A {
public constructor A()
public final val bar: kotlin.Int
public final val baz: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final inline fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -581,6 +581,12 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
doTest(fileName);
}
@TestMetadata("inline.kt")
public void testInline() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/native/inline.kt");
doTest(fileName);
}
@TestMetadata("innerClass.kt")
public void testInnerClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/native/innerClass.kt");