Skip to content

Unable to use reified type parameter in wrap method #11

@tKe

Description

@tKe

In some cases it may be useful to have access to type information when wrapping a parameter for invocation of an interpolator. An example usage if this would be a JSON interpolator using the kotlinx-serialization json types and intending to wrap parameters implicitly to JsonElement using the reified Json#encodeToJsonElement(value: T) helper.

Alternatively, if reified/inline functions are an issue, being able to support a KType parameter in the wrap method signatures would allow for an invocation similar to fun MyInterpolator.wrap(value: Any, typeInfo: KType) = json.encodeToJsonElement(serializer(typeInfo), value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions