diff --git a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt index da15a23c072..2cb3958c093 100644 --- a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt +++ b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KotlinLightClassForPackage.kt @@ -93,7 +93,7 @@ public class KotlinLightClassForPackage private( private val implementsList: LightEmptyImplementsList = LightEmptyImplementsList(manager) - private val packageClsFile: ClsFileImpl = KotlinJavaFileStubProvider.createFakeClsFile(manager.getProject(), packageClassFqName, files) { + private val packageClsFile: ClsFileImpl = KotlinJavaFileStubProvider.createFakeClsFile(manager.getProject(), packageFqName, files) { (getDelegate().getContainingFile() as ClsFileImpl).getStub() } diff --git a/idea/testData/editor/quickDoc/KotlinPackageClassUsedFromJava.java b/idea/testData/editor/quickDoc/KotlinPackageClassUsedFromJava.java index fe661cd0b39..1f110237f47 100644 --- a/idea/testData/editor/quickDoc/KotlinPackageClassUsedFromJava.java +++ b/idea/testData/editor/quickDoc/KotlinPackageClassUsedFromJava.java @@ -6,4 +6,4 @@ class KotlinPackageClassUsedFromJava { } } -//INFO: [light_idea_test_case] testing.TestingPackage... +//INFO: [light_idea_test_case] testing... diff --git a/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.java b/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.java new file mode 100644 index 00000000000..c219126dc46 --- /dev/null +++ b/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.java @@ -0,0 +1,11 @@ +package test; + +import org.jetbrains.annotations.NotNull; +import test.kotlin.KotlinPackage; + +public class TopLevelFunctionInDataFlowInspection { + void other(@NotNull Object some) { + Object foo = KotlinPackage.foo(some); + } +} + diff --git a/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.kt b/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.kt new file mode 100644 index 00000000000..c1d9225f975 --- /dev/null +++ b/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.kt @@ -0,0 +1,3 @@ +package test.kotlin + +fun foo(a: Any): Any = a \ No newline at end of file diff --git a/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.txt b/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.txt new file mode 100644 index 00000000000..667982be541 --- /dev/null +++ b/idea/testData/kotlinAndJavaChecker/TopLevelFunctionInDataFlowInspection.txt @@ -0,0 +1 @@ +// TOOL: DataFlowInspection \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/checkers/KotlinAndJavaCheckerTest.java b/idea/tests/org/jetbrains/kotlin/checkers/KotlinAndJavaCheckerTest.java index 65823ba375e..b336c1398d8 100644 --- a/idea/tests/org/jetbrains/kotlin/checkers/KotlinAndJavaCheckerTest.java +++ b/idea/tests/org/jetbrains/kotlin/checkers/KotlinAndJavaCheckerTest.java @@ -97,6 +97,10 @@ public class KotlinAndJavaCheckerTest extends KotlinDaemonAnalyzerTestCase { doTest(true, true, "NoNotNullOnParameterInOverride.java", "NoNotNullOnParameterInOverride.kt"); } + public void testTopLevelFunctionInDataFlowInspection() throws Exception { + doTest(true, true, "TopLevelFunctionInDataFlowInspection.java", "TopLevelFunctionInDataFlowInspection.kt"); + } + public void testUsingKotlinPackageDeclarations() throws Exception { doTest(true, true, "UsingKotlinPackageDeclarations.java", "UsingKotlinPackageDeclarations.kt"); }