KJS: don't load declarations marked by PlatformDependent annotation
#KT-17450 Fixed
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
fun test(m: Map<String, Int>, mm: MutableMap<Int, String>) {
|
||||
m.<!UNRESOLVED_REFERENCE!>getOrDefault<!>("2", 1)
|
||||
mm.<!UNRESOLVED_REFERENCE!>getOrDefault<!>(1, "2")
|
||||
mm.remove(1, <!TOO_MANY_ARGUMENTS!>"2"<!>)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ m: kotlin.collections.Map<kotlin.String, kotlin.Int>, /*1*/ mm: kotlin.collections.MutableMap<kotlin.Int, kotlin.String>): kotlin.Unit
|
||||
@@ -54,6 +54,12 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("platformDependent.kt")
|
||||
public void testPlatformDependent() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/platformDependent.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("runtimeAnnotations.kt")
|
||||
public void testRuntimeAnnotations() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/runtimeAnnotations.kt");
|
||||
|
||||
+3
-1
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.NotFoundClasses
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProviderImpl
|
||||
import org.jetbrains.kotlin.descriptors.deserialization.PlatformDependentDeclarationFilter
|
||||
import org.jetbrains.kotlin.incremental.components.LookupTracker
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
@@ -56,7 +57,8 @@ fun createKotlinJavascriptPackageFragmentProvider(
|
||||
lookupTracker,
|
||||
DynamicTypeDeserializer,
|
||||
emptyList(),
|
||||
notFoundClasses
|
||||
notFoundClasses,
|
||||
platformDependentDeclarationFilter = PlatformDependentDeclarationFilter.NoPlatformDependent
|
||||
)
|
||||
|
||||
for (packageFragment in packageFragments) {
|
||||
|
||||
Reference in New Issue
Block a user