Allow to exclude specific types from packages imported by default.

This commit is contained in:
Ilya Gorbunov
2016-08-11 20:18:17 +03:00
parent 0f8bf310f2
commit afe1b7eab1
10 changed files with 41 additions and 25 deletions
@@ -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() {