Eliminate some warnings (mostly redundant is checks in whens)

This commit is contained in:
Mikhail Glukhikh
2017-08-16 12:52:35 +03:00
committed by Mikhail Glukhikh
parent 3623f581b8
commit 9dc5354f24
6 changed files with 6 additions and 12 deletions
@@ -38,8 +38,7 @@ fun KtElement.suppressDiagnosticsInDebugMode(): Boolean {
var KtFile.suppressDiagnosticsInDebugMode: Boolean
get() = when (this) {
is KtCodeFragment -> true
is KtFile -> getUserData(SUPPRESS_DIAGNOSTICS_IN_DEBUG_MODE) ?: false
else -> false
else -> getUserData(SUPPRESS_DIAGNOSTICS_IN_DEBUG_MODE) ?: false
}
set(skip) {
putUserData(SUPPRESS_DIAGNOSTICS_IN_DEBUG_MODE, skip)
@@ -350,7 +350,7 @@ private fun FunctionDescriptor.generateDefaultsFunction(context: CommonBackendCo
/* annotations = */ annotations,
/* isPrimary = */ false,
/* source = */ source)
is FunctionDescriptor -> {
else -> {
val name = Name.identifier("$name\$default")
SimpleFunctionDescriptorImpl.create(
@@ -360,7 +360,6 @@ private fun FunctionDescriptor.generateDefaultsFunction(context: CommonBackendCo
/* kind = */ CallableMemberDescriptor.Kind.SYNTHESIZED,
/* source = */ source)
}
else -> TODO("FIXME: $this")
}
val syntheticParameters = MutableList(valueParameters.size / 32 + 1) { i ->