compiler-plugin / arrow.meta.quotes.modifierlistowner / TypeReference

TypeReference

class TypeReference : Scope<KtTypeReference>

A template destructuring Scope for a TypeReference.

import arrow.meta.Meta
import arrow.meta.CliPlugin
import arrow.meta.invoke
import arrow.meta.quotes.Transform
import arrow.meta.quotes.typeReference

val Meta.changeTypeReference: CliPlugin
   get() =
     "ReformatModifier" {
       meta(
         typeReference(this, { true }) { modifierListOwner ->
           Transform.replace(
             replacing = modifierListOwner,
             newDeclaration = """$`@annotations` $typeElement""".type
           )
         }
       )
     }

Constructors

<init> A template destructuring Scope for a TypeReference.TypeReference(value: KtTypeReference?, typeElement: Scope<KtTypeElement>? = Scope(value?.typeElement), @annotations: ScopedList<KtAnnotationEntry> = ScopedList(separator = " ", value = value?.annotationEntries.orEmpty()))

Properties

@annotations val @annotations: ScopedList<KtAnnotationEntry>
typeElement val typeElement: Scope<KtTypeElement>?
value val value: KtTypeReference?

Functions

identity fun ElementScope.identity(): TypeReference

Extension Functions

map fun <K : KtElement> Scope<K>.map(f: (K) -> K): Scope<K>
orEmpty fun <K : KtElement> Scope<K>?.orEmpty(): Scope<K>

Do you like Arrow?

Arrow Org
<