Fix some compiler warnings in FIR modules

This commit is contained in:
Alexander Udalov
2020-08-14 12:37:13 +02:00
parent ced151f3af
commit 549ee84687
24 changed files with 71 additions and 78 deletions
@@ -69,7 +69,7 @@ fun SmartPrinter.printImplementation(implementation: Implementation) {
}
println("(")
withIndent {
fieldsWithoutDefault.forEachIndexed { i, field ->
fieldsWithoutDefault.forEachIndexed { _, field ->
printField(field, isImplementation = true, override = true, end = ",")
}
}
@@ -52,9 +52,11 @@ private fun updateKinds(solution: List<Boolean>, elementMapping: ElementMapping)
val element = elementMapping[index * 2].origin
val existingKind = element.kind
if (isClass) {
when (existingKind) {
Implementation.Kind.Interface -> throw IllegalStateException(element.toString())
null -> element.kind = when (element) {
if (existingKind == Implementation.Kind.Interface)
throw IllegalStateException(element.toString())
if (existingKind == null) {
element.kind = when (element) {
is Implementation -> {
if (elementMapping.hasInheritors(element))
Implementation.Kind.AbstractClass