Multi-platform fix: no more errors for top-level impl fun / val / var in IDE

This commit is contained in:
Mikhail Glukhikh
2016-12-16 16:11:43 +03:00
parent 63cc5d872d
commit 5947d49dee
8 changed files with 35 additions and 3 deletions
@@ -142,9 +142,7 @@ class HeaderImplDeclarationChecker(val moduleToCheck: ModuleDescriptor? = null)
is FunctionDescriptor -> scope.getContributedFunctions(name, NoLookupLocation.FOR_ALREADY_TRACKED)
is PropertyDescriptor -> scope.getContributedVariables(name, NoLookupLocation.FOR_ALREADY_TRACKED)
else -> throw AssertionError("Unsupported declaration: $this")
}.filter {
it.module == myModule // TODO: only obtain descriptors from our module to start with
}
} // TODO: only obtain descriptors from our module to start with
}
fun ClassifierDescriptorWithTypeParameters.findClassifiersFromTheSameModule(): Collection<ClassifierDescriptorWithTypeParameters> {
@@ -0,0 +1,2 @@
header val bar: String
@@ -0,0 +1 @@
impl val bar = "Hello"
@@ -0,0 +1,7 @@
-- Common --
Exit code: OK
Output:
-- JVM --
Exit code: OK
Output:
@@ -36,6 +36,12 @@ public class MultiPlatformIntegrationTestGenerated extends AbstractMultiPlatform
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/multiplatform"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
@TestMetadata("compatibleProperties")
public void testCompatibleProperties() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/multiplatform/compatibleProperties/");
doTest(fileName);
}
@TestMetadata("genericDeclarations")
public void testGenericDeclarations() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/multiplatform/genericDeclarations/");
@@ -0,0 +1,3 @@
header fun foo(): Int
header val bar: String
@@ -0,0 +1,3 @@
impl fun foo() = 42
impl val bar = "Hello"
@@ -112,4 +112,16 @@ class MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() {
checkHighlightingInAllFiles()
}
fun testPlatform5() {
val header = module("header")
header.setPlatformKind(TargetPlatformKind.Default)
val jvm = module("jvm")
jvm.setPlatformKind(TargetPlatformKind.Jvm.JVM_1_6)
jvm.enableMultiPlatform()
jvm.addDependency(header)
checkHighlightingInAllFiles()
}
}