Allow to exclude specific types from packages imported by default.
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ class RuntimeModuleData private constructor(val deserialization: Deserialization
|
||||
val storageManager = LockBasedStorageManager()
|
||||
val builtIns = JvmBuiltIns(storageManager)
|
||||
val module = ModuleDescriptorImpl(Name.special("<runtime module for $classLoader>"), storageManager,
|
||||
ModuleParameters(listOf(), JavaToKotlinClassMap.INSTANCE), builtIns)
|
||||
ModuleParameters(emptyList(), emptyList(), JavaToKotlinClassMap.INSTANCE), builtIns)
|
||||
|
||||
val reflectKotlinClassFinder = ReflectKotlinClassFinder(classLoader)
|
||||
val deserializedDescriptorResolver = DeserializedDescriptorResolver(RuntimeErrorReporter)
|
||||
|
||||
@@ -49,6 +49,7 @@ interface ModuleDescriptor : DeclarationDescriptor, ModuleParameters {
|
||||
|
||||
interface ModuleParameters {
|
||||
val defaultImports: List<ImportPath>
|
||||
val excludedImports: List<FqName> get() = emptyList()
|
||||
val platformToKotlinClassMap: PlatformToKotlinClassMap
|
||||
|
||||
object Empty: ModuleParameters {
|
||||
@@ -57,8 +58,9 @@ interface ModuleParameters {
|
||||
}
|
||||
}
|
||||
|
||||
fun ModuleParameters(defaultImports: List<ImportPath>, platformToKotlinClassMap: PlatformToKotlinClassMap): ModuleParameters =
|
||||
fun ModuleParameters(defaultImports: List<ImportPath>, excludedImports: List<FqName>, platformToKotlinClassMap: PlatformToKotlinClassMap): ModuleParameters =
|
||||
object : ModuleParameters {
|
||||
override val defaultImports: List<ImportPath> = defaultImports
|
||||
override val excludedImports: List<FqName> get() = excludedImports
|
||||
override val platformToKotlinClassMap: PlatformToKotlinClassMap = platformToKotlinClassMap
|
||||
}
|
||||
|
||||
@@ -69,6 +69,12 @@ public class ErrorUtils {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<FqName> getExcludedImports() {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Annotations getAnnotations() {
|
||||
|
||||
Reference in New Issue
Block a user