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:
ProtoInterpolator is the second subtype, e.g. object HtmlAppender : Any(), ProtoInterpolator<Any?, Unit>
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: