Skip to content

Interpolator inheritance over-specificity required #9

Description

@ivan-gomes

When using an @InterpolatorFunction (and perhaps elsewhere) the referenced (Proto)Interpolator object must have as its first subtype ProtoInterpolator<T, R>. It results in an error,

Error transforming expression: Fatal Exception: The interpolator type InterpolatingAppender has no 2nd argument (i.e. the output-type)

if either:

  1. ProtoInterpolator is the second subtype, e.g. object HtmlAppender : Any(), ProtoInterpolator<Any?, Unit>
  2. ProtoInterpolator is inherited, e.g.
object HtmlAppender : InterpolatingAppender()

abstract class InterpolatingAppender : ProtoInterpolator<Any?, Unit>

A workaround is to explicitly re-specify a subtyping of ProtoInterpolator as the first subtype of the object, e.g.

object HtmlAppender : ProtoInterpolator<Any?, Unit>, InterpolatingAppender()

References:

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