diff --git a/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt new file mode 100644 index 00000000000..32ec476d58a --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt @@ -0,0 +1,36 @@ +// FILE: backend/asmutil/AsmUtil.java +package backend.asmutil; + +import org.jetbrains.annotations.NotNull; +import static frontend.JvmDeclarationOrigin.NO_ORIGIN; + +public class AsmUtil { + + @NotNull + public static String doSmth(String s) { + Object or = NO_ORIGIN; + return "OK"; + } +} + +// FILE: First.kt +package frontend +public class JvmDeclarationOrigin { + class object { + public val NO_ORIGIN: JvmDeclarationOrigin = JvmDeclarationOrigin() + } +} + +// FILE: Second.kt +package backend + +import backend.asmutil.AsmUtil.doSmth + +open public class ECallable { + fun test() { + doSmth("") + } +} + +/* KT-5848 */ + diff --git a/compiler/testData/diagnostics/tests/j+k/javaStaticImport.txt b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.txt new file mode 100644 index 00000000000..6da21649582 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.txt @@ -0,0 +1,43 @@ +package + +package backend { + + public open class ECallable { + public constructor ECallable() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + internal final fun test(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + package backend.asmutil { + + public open class AsmUtil { + public constructor AsmUtil() + 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 + + // Static members + org.jetbrains.annotations.NotNull() public open fun doSmth(/*0*/ s: kotlin.String!): kotlin.String! + } + } +} + +package frontend { + + public final class JvmDeclarationOrigin { + public constructor JvmDeclarationOrigin() + 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 + + public class object { + private constructor () + public final val NO_ORIGIN: frontend.JvmDeclarationOrigin + 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 + } + } +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 495a97da3ed..cf24349fec2 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -6269,7 +6269,13 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/invisiblePackagePrivateInheritedMember.kt"); doTest(fileName); } - + + @TestMetadata("javaStaticImport.kt") + public void testJavaStaticImport() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt"); + doTest(fileName); + } + @TestMetadata("KJKInheritance.kt") public void testKJKInheritance() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/KJKInheritance.kt");