[FIR/IR generator] Refactor element parents
- Move `elementParents` and `otherParents` properties to `AbstractElement` - Use `elementParents` instead of `parentRefs` where needed
This commit is contained in:
committed by
Space Team
parent
33994d419d
commit
5798021e4b
+10
-2
@@ -20,13 +20,21 @@ abstract class AbstractElement<Element, Field> : ElementOrRef<Element, Field>, F
|
||||
|
||||
abstract val params: List<TypeVariable>
|
||||
|
||||
abstract val parentRefs: List<ElementOrRef<Element, Field>>
|
||||
abstract val elementParents: List<ElementRef<Element, Field>>
|
||||
|
||||
abstract val otherParents: List<ClassRef<*>>
|
||||
|
||||
val parentRefs: List<ClassOrElementRef>
|
||||
get() = elementParents + otherParents
|
||||
|
||||
val isRootElement: Boolean
|
||||
get() = elementParents.isEmpty()
|
||||
|
||||
open val isSealed: Boolean
|
||||
get() = false
|
||||
|
||||
override val allParents: List<Element>
|
||||
get() = parentRefs.map { it.element }
|
||||
get() = elementParents.map { it.element }
|
||||
|
||||
final override fun getTypeWithArguments(notNull: Boolean): String = type + generics
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ interface TypeRef : Importable {
|
||||
}
|
||||
}
|
||||
|
||||
interface ClassOrElementRef : TypeRefWithNullability
|
||||
sealed interface ClassOrElementRef : TypeRefWithNullability
|
||||
|
||||
// Based on com.squareup.kotlinpoet.ClassName
|
||||
class ClassRef<P : TypeParameterRef> private constructor(
|
||||
|
||||
Reference in New Issue
Block a user