Take into account excluded fq-names when determining whether type has been imported by default.

Related to #KT-13447
This commit is contained in:
Ilya Gorbunov
2016-08-16 19:35:11 +03:00
parent e34bc30bd7
commit d845092b20
4 changed files with 20 additions and 3 deletions
@@ -54,4 +54,8 @@ fun ImportPath.isImported(alreadyImported: ImportPath): Boolean {
return if (isAllUnder || hasAlias()) this == alreadyImported else fqnPart().isImported(alreadyImported)
}
fun ImportPath.isImported(imports: Iterable<ImportPath>): Boolean = imports.any { isImported(it) }
private fun ImportPath.isImported(imports: Iterable<ImportPath>): Boolean = imports.any { isImported(it) }
fun ImportPath.isImported(imports: Iterable<ImportPath>, excludedFqNames: Iterable<FqName>): Boolean {
return isImported(imports) && (isAllUnder || this.fqnPart() !in excludedFqNames)
}