[FIR generator] Deduplicate the logic of needPureAbstractElement
This commit is contained in:
committed by
Space Team
parent
45792c2e60
commit
9a4c28498c
+1
-1
@@ -98,7 +98,7 @@ fun SmartPrinter.printImplementation(implementation: Implementation) {
|
||||
}
|
||||
|
||||
print(" : ")
|
||||
if (!isInterface && !allParents.any { it.kind == ImplementationKind.AbstractClass || it.kind == ImplementationKind.SealedClass }) {
|
||||
if (needPureAbstractElement) {
|
||||
print("${pureAbstractElementType.type}(), ")
|
||||
}
|
||||
print(allParents.joinToString { "${it.typeWithArguments}${it.kind.braces()}" })
|
||||
|
||||
-4
@@ -113,10 +113,6 @@ private fun List<String>.filterRedundantImports(
|
||||
}
|
||||
|
||||
|
||||
val ImplementationKindOwner.needPureAbstractElement: Boolean
|
||||
get() = (kind != ImplementationKind.Interface && kind != ImplementationKind.SealedInterface) && !allParents.any { it.kind == ImplementationKind.AbstractClass || it.kind == ImplementationKind.SealedClass }
|
||||
|
||||
|
||||
val Field.isVal: Boolean
|
||||
get() = (this is FieldList && !isMutableOrEmpty) || (this is FieldWithDefault && origin is FieldList && !origin.isMutableOrEmpty) || !isMutable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user