CollectionWrapperValidator

class CollectionWrapperValidator(logger: KSPLogger)

Validates a @CollectionWrapper object's duck-typed contract against its forType. Kotlin has no higher-kinded types, so the shapes are conventions — compile-checked here:

fun <T> wrap(source: List<T>): ForType<T>
fun <T> unwrap(source: ForType<T>): List<T>

Both directions are optional, at least one is required. A function named wrap/unwrap with the wrong shape (parameter/return container, parameter count, or type-parameter count) is a compile error naming the expected signature — never silently skipped.

Constructors

Link copied to clipboard
constructor(logger: KSPLogger)

Functions

Link copied to clipboard
fun validate(wrapperDeclaration: KSClassDeclaration, forTypeFqn: String): CollectionWrapperDescriptor?

Returns the validated descriptor, or null when the wrapper violates the contract (errors already logged — compilation fails).