Skip to content

Commit

Permalink
Annotation processor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Jul 18, 2024
1 parent bc5b41c commit 9deffea
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RouterGeneration(
it.asSequence().mapNotNull { (it as? ParsedRoutable.Segment.Variable)?.type }
} + it.queryParameters.map { it.type }
}
.flatMap { sequenceOf(it) + it.arguments.mapNotNull { it.type?.resolve() } }
.flatMap { sequenceOf(it) + it.arguments.mapNotNull { it.type?.resolve() } + it.annotations.mapNotNull { it.annotationType.resolve() } }
.mapNotNull { it.declaration.qualifiedName?.asString() }
.distinct()
.filter { !it.startsWith("kotlin.") }
Expand Down Expand Up @@ -215,9 +215,9 @@ class ParsedRoutable(
}

fun KSTypeReference.toKotlin(annotations: Sequence<KSAnnotation>? = null): String =
this.resolve().toKotlin(annotations ?: this.resolve().annotations)
this.resolve().toKotlin(annotations ?: sequenceOf())

fun KSType.toKotlin(annotations: Sequence<KSAnnotation> = this.annotations): String {
fun KSType.toKotlin(annotations: Sequence<KSAnnotation> = sequenceOf()): String {
(this.declaration as? KSTypeParameter)?.let { return it.name.asString() }

val annotationString = annotations.joinToString(" ") {
Expand Down

0 comments on commit 9deffea

Please sign in to comment.