JS: prohibit external fun interface
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
external fun interface <!WRONG_EXTERNAL_DECLARATION!>I<!> {
|
||||
fun f()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package
|
||||
|
||||
public external fun interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+5
@@ -681,6 +681,11 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
|
||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/native/extensionFunctionArgumentOrReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("externalFunInterface.kt")
|
||||
public void testExternalFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/native/externalFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("externalInterfaceNested.kt")
|
||||
public void testExternalInterfaceNested() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/native/externalInterfaceNested.kt");
|
||||
|
||||
@@ -44,6 +44,7 @@ object JsExternalChecker : DeclarationChecker {
|
||||
descriptor.isData -> "data class"
|
||||
descriptor.isInner -> "inner class"
|
||||
descriptor.isInline -> "inline class"
|
||||
descriptor.isFun -> "fun interface"
|
||||
DescriptorUtils.isAnnotationClass(descriptor) -> "annotation class"
|
||||
else -> null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user