diff --git a/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/common/common.kt b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/common/common.kt new file mode 100644 index 00000000000..154e1b86f72 --- /dev/null +++ b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/common/common.kt @@ -0,0 +1,5 @@ +data class CommonDataClass(val property: CommonObject?) + +object CommonObject { + fun doSomething() {} +} \ No newline at end of file diff --git a/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/dependencies.txt b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/dependencies.txt new file mode 100644 index 00000000000..c368ab48d9b --- /dev/null +++ b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/dependencies.txt @@ -0,0 +1,7 @@ +MODULE common { platform=[JVM, JS, Native] } +MODULE jvm1 { platform=[JVM] } +MODULE jvm2 { platform=[JVM] } + +jvm1 -> common { kind=DEPENDS_ON } +jvm2 -> common { kind=DEPENDS_ON } +jvm2 -> jvm1 { kind=DEPENDENCY } diff --git a/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/jvm1/jvm1.kt b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/jvm1/jvm1.kt new file mode 100644 index 00000000000..1213364806f --- /dev/null +++ b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/jvm1/jvm1.kt @@ -0,0 +1,5 @@ +data class JvmDataClass(val property: JvmObject?) + +object JvmObject { + fun doSomething() {} +} \ No newline at end of file diff --git a/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/jvm2/jvm2.kt b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/jvm2/jvm2.kt new file mode 100644 index 00000000000..f541db28ea9 --- /dev/null +++ b/idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/jvm2/jvm2.kt @@ -0,0 +1,9 @@ +fun test(fromCommon: CommonDataClass, fromJvm: JvmDataClass) { + if (fromCommon.property != null) { + fromCommon.property.doSomething() + } + + if (fromJvm.property != null) { + fromJvm.property.doSomething() + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiplatformAnalysisTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiplatformAnalysisTestGenerated.java index 793a5ef65e8..10c882c18af 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiplatformAnalysisTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiplatformAnalysisTestGenerated.java @@ -208,6 +208,11 @@ public class MultiplatformAnalysisTestGenerated extends AbstractMultiplatformAna runTest("idea/testData/multiplatform/simple/"); } + @TestMetadata("simple") + public void testSmartCastOnPropertyFromDependentModule() throws Exception { + runTest("idea/testData/multiplatform/smartCastOnPropertyFromDependentModule/"); + } + @TestMetadata("supertypes") public void testSupertypes() throws Exception { runTest("idea/testData/multiplatform/supertypes/");