Skip to content

Instantly share code, notes, and snippets.

View heksesang's full-sized avatar

Gunnar Lilleaasen heksesang

View GitHub Profile
@heksesang
heksesang / bad_param_ref.scala
Created February 19, 2020 11:31
Reproducible sample of "bad parameter reference hlist.T at typer" error
object hlists
enum HList
case :*:[+H, +T <: HList](head: H, tail: T)
case HNil
def :*:[H](h: H): H :*: this.type = new HList.:*:(h, this)
override def toString: String = this match
case HList.:*:(head, tail) => s"($head) :: $tail"
case HList.HNil => "HNil"
import shapeless._
import shapeless.labelled._
import syntax.singleton._
sealed trait Event[A] {
def replay(initial: Option[A]): Option[A]
}
case class NameChangedEvent[A: NameChangedEvent.Update](name: String) extends Event[A] {
def replay(initial: Option[A]): Option[A] =