Determine automatically which types from java.lang is aliased in default imported kotlin packages and exclude them from imported java.lang.* scope.
This commit is contained in:
+1
-13
@@ -62,16 +62,4 @@ private val DEFAULT_IMPORTS_FOR_JVM: List<ImportPath> = ArrayList<ImportPath>().
|
||||
}
|
||||
}
|
||||
|
||||
private val EXCLUDED_IMPORTS_FOR_JVM: List<FqName> = listOf(
|
||||
"Error",
|
||||
"Exception",
|
||||
"RuntimeException",
|
||||
"IllegalArgumentException",
|
||||
"IllegalStateException",
|
||||
"IndexOutOfBoundsException",
|
||||
"UnsupportedOperationException",
|
||||
"NumberFormatException",
|
||||
"NullPointerException",
|
||||
"ClassCastException",
|
||||
"AssertionError"
|
||||
).map { FqName("java.lang.$it") }
|
||||
private val EXCLUDED_IMPORTS_FOR_JVM: List<FqName> = emptyList()
|
||||
@@ -95,7 +95,7 @@ class FileScopeFactory(
|
||||
val allUnderImportResolver = createImportResolver(AllUnderImportsIndexed(imports), bindingTrace) // TODO: should we count excludedImports here also?
|
||||
|
||||
val defaultExplicitImportResolver = createImportResolver(ExplicitImportsIndexed(defaultImportsFiltered), tempTrace)
|
||||
val defaultAllUnderImportResolver = createImportResolver(AllUnderImportsIndexed(defaultImportsFiltered), tempTrace, moduleDescriptor.excludedImports)
|
||||
val defaultAllUnderImportResolver = createImportResolver(AllUnderImportsIndexed(defaultImportsFiltered), tempTrace, moduleDescriptor.effectivelyExcludedImports)
|
||||
|
||||
val dummyContainerDescriptor = DummyContainerDescriptor(file, packageFragment)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user