-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Specializing the quantity would prevent boxing of base numeric types, which unfortunately happens with AnyVal.
However, specialization doesn't seem to play well with singletons and dependent types.
We get the following bizarre error:
[error] /home/zainab/coding/ithaca/libra/src/main/scala/libra/quantity.scala:36: type mismatch;
[error] found : a.Out
[error] required: a.Out
[error] def add[D1 <: HList](q1: Quantity[A, D1])(implicit a: Add[Quantity[A, D], Quantity[A, D1]]): a.Out = a(this, q1)Debug logging on the typer phase gives a lot of:
[warn] !!! HK subtype check on [A]collection.this.SeqLike[A,CC[A]] and scala.this.Singleton, but both don't normalize to polytypes:
[warn] tp1=[A]collection.this.SeqLike[A,CC[A]] PolyType
[warn] tp2=scala.this.Singleton ClassNoArgsTypeRefIs this a scalac bug? Is it a feature? Is it a known issue? Any solutions?
Metadata
Metadata
Assignees
Labels
No labels