mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-26 03:58:45 +00:00
fixes in ksp sealed generator
This commit is contained in:
parent
4913e99c2e
commit
ad401105a1
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## 0.21.6
|
## 0.21.6
|
||||||
|
|
||||||
|
* `KSP`:
|
||||||
|
* `Sealed`:
|
||||||
|
* Fixes in generation
|
||||||
|
|
||||||
## 0.21.5
|
## 0.21.5
|
||||||
|
|
||||||
* `KSP`:
|
* `KSP`:
|
||||||
|
@ -26,7 +26,8 @@ class Processor(
|
|||||||
private fun KSClassDeclaration.findSealedConnection(potentialSealedParent: KSClassDeclaration): Boolean {
|
private fun KSClassDeclaration.findSealedConnection(potentialSealedParent: KSClassDeclaration): Boolean {
|
||||||
val targetClassname = potentialSealedParent.qualifiedName ?.asString()
|
val targetClassname = potentialSealedParent.qualifiedName ?.asString()
|
||||||
return superTypes.any {
|
return superTypes.any {
|
||||||
targetClassname == ((it.resolve().declaration as? KSClassDeclaration) ?.qualifiedName ?.asString()) || (it is KSClassDeclaration && it.getSealedSubclasses().any() && it.findSealedConnection(potentialSealedParent))
|
val itAsDeclaration = it.resolve().declaration as? KSClassDeclaration ?: return@any false
|
||||||
|
targetClassname == (itAsDeclaration.qualifiedName ?.asString()) || (itAsDeclaration.getSealedSubclasses().any() && itAsDeclaration.findSealedConnection(potentialSealedParent))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user