Cleanup: post-cleanup after deprecation cleanup in compiler

Replace `takeIf { !expr }` with `takeUnless { expr }`.
Cleanup redundant parethesis as in `listOf((expr))`.
Replace `listOf(expr)` with `expr.let(::listOf)` where the former caused significant indentation change.
This commit is contained in:
Ilya Gorbunov
2017-03-17 16:06:28 +03:00
parent e599688733
commit dce0da68c6
24 changed files with 43 additions and 48 deletions
@@ -417,12 +417,12 @@ class QualifiedExpressionResolver {
val qualifierDescriptor = when (receiver) {
is PackageQualifier -> {
val childPackageFQN = receiver.descriptor.fqName.child(name)
receiver.descriptor.module.getPackage(childPackageFQN).takeIf { !it.isEmpty() } ?:
receiver.descriptor.module.getPackage(childPackageFQN).takeUnless { it.isEmpty() } ?:
receiver.descriptor.memberScope.getContributedClassifier(name, location)
}
is ClassQualifier -> receiver.staticScope.getContributedClassifier(name, location)
null -> context.scope.findClassifier(name, location) ?:
context.scope.ownerDescriptor.module.getPackage(FqName.ROOT.child(name)).takeIf { !it.isEmpty() }
context.scope.ownerDescriptor.module.getPackage(FqName.ROOT.child(name)).takeUnless { it.isEmpty() }
is ReceiverValue -> receiver.type.memberScope.memberScopeAsImportingScope().findClassifier(name, location)
else -> null
}
@@ -55,7 +55,7 @@ class DefaultImportProvider(
defaultImports
.filter { it.isAllUnder }
.mapNotNull {
it.fqName.takeIf { !it.isSubpackageOf(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME) }
it.fqName.takeUnless { it.isSubpackageOf(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME) }
}
val nonKotlinAliasedTypeFqNames =
builtinTypeAliases