-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HMap.get does not support subtypes of keys #810
Comments
I've had a bit more of a play around, and providing this implicit seems to allow subclassing to work as expected: implicit def idValueWitnessSubclass[K[_], K1[_] <: K[_], T](implicit rel: K ~?> Id): (K ~?> Id)#λ[K1[T], Id[T]] = new rel.λ Would it be worth adding this (and |
Not sure if anyone is still watching this, but I've run into a similar issue. The documentation is pretty class FieldMap[Op <: OpBase[Op, Node], Node <: NodeBase[Op, Node], UpdaterT <: AtomicFieldUpdater[Node, FieldT], FieldT]
implicit def updaterToCacheValue[Op <: OpBase[Op, Node], Node <: NodeBase[Op, Node], UpdaterT <: AtomicFieldUpdater[Node, FieldT], FieldT]:FieldMap[Op,Node,UpdaterT,FieldT] = new FieldMap[Op,Node,UpdaterT,FieldT]
type FieldHMap[Op <: OpBase[Op, NodeT], Node <: NodeBase[Op, Node]] = HMap[Lambda[(`UpdaterT <: AtomicFieldUpdater[Node, FieldT]`, FieldT) => FieldMap[Op, Node, UpdaterT, FieldT]]] ( The error message I get is:
|
Regular
Map.get
allows using subtypes:but the same isn't true of
HMap
, because it can't resolve the implicits necessary to prove that the value type is correct:Would it be possible / sensible to make
~?>.λ
variant inK
, or would that cause other problems?The text was updated successfully, but these errors were encountered: