|
1
1
难道你不想
在这种情况下,您的代码似乎是在Scala 3中编译的 https://scastie.scala-lang.org/qVMDsu7HRLiBFlSchGxWEA
当你放松对
你也可以试着
Bind wildcard type argument in Scala ( answer ) 你也可以尝试一个类型类
尽管类型类实例必须静态解析,而您似乎更喜欢动态解析值(
http://tpolecat.github.io/2015/04/29/f-bounds.html Advantages of F-bounded polymorphism over typeclass for return-current-type problem |
|
|
2
1
错误是由以下两者之间的冲突引起的
要解决冲突,您可以使用
然后,扩展类型
定义一个帮助者特征可能会有所帮助,以节省一些键入:
然而
这可以通过松开上的限制来解决
|