Map on HList in method with Poly1 based on type parameter of class

落爺英雄遲暮 提交于 2019-12-03 16:03:19

This is a bug in the Scala compiler (both 2.9.2 and 2.10.0-RC1).

As a workaround, if you split the creation of the instance of Test and the invocation of the test method across two expression then it works as expected,

scala> val t = new Test(1 :: HNil, 'a)
t: Test[shapeless.::[Int,shapeless.HNil],Symbol] = Test@4b153b34

scala> t.test
res0: shapeless.::[(Symbol, Int),shapeless.HNil] = ('a,1) :: HNil
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!