Scala 类型别名的隐式转换在他的代码中似乎不起作用 trait-TriIndexable[M[u,u,u,u]]{ def get[A,B,C,D](m:m[A,B,C,D])(A:A,B:B,C:C):单位 } 隐式对象TriMapTriIndexable扩展了TriIndexable[TriMap]{ def get[A,B,C,D](m:TriMap[A,B,C,D])(A:A,B:B,C:C):单位={ println(“三索引get”) } } 类型TriIntMap[D]=TriMap[Int,Int,Int,D] 性状元组不可索引[M[]]{ def get[D](m:m[D])(a:(Int,Int,Int)):单位 } 隐式对象TriIntMapTupleIntIndexable扩展了TupleIntIndexable[TriIntMap]{ def get[D](m:TriIntMap[D])(a:(Int,Int,Int)):单位={ println(“Tri-Int可转位get”) } } 类TriMap[A,B,C,D](){ } 隐式类三索引运算[A,B,C,D,M[,,,,]]( val tri:M[A,B,C,D] )(隐式ev:TriIndexable[M]){ def get(a:a,b:b,c:c)={ ev.get(tri)(a、b、c) } } 隐式类TupleIntinIndexableOps[D,M[]]( val tri:M[D] )(隐式ev:TupleIntinIndexable[M]){ def get(a:(Int,Int,Int))={ ev.get(tri)(a) } } val测试:TriIntMap[String]=newtrimap[Int,Int,Int,String]() 测试。获取(5,5,5) 测试。获取((5,5,5))

Scala 类型别名的隐式转换在他的代码中似乎不起作用 trait-TriIndexable[M[u,u,u,u]]{ def get[A,B,C,D](m:m[A,B,C,D])(A:A,B:B,C:C):单位 } 隐式对象TriMapTriIndexable扩展了TriIndexable[TriMap]{ def get[A,B,C,D](m:TriMap[A,B,C,D])(A:A,B:B,C:C):单位={ println(“三索引get”) } } 类型TriIntMap[D]=TriMap[Int,Int,Int,D] 性状元组不可索引[M[]]{ def get[D](m:m[D])(a:(Int,Int,Int)):单位 } 隐式对象TriIntMapTupleIntIndexable扩展了TupleIntIndexable[TriIntMap]{ def get[D](m:TriIntMap[D])(a:(Int,Int,Int)):单位={ println(“Tri-Int可转位get”) } } 类TriMap[A,B,C,D](){ } 隐式类三索引运算[A,B,C,D,M[,,,,]]( val tri:M[A,B,C,D] )(隐式ev:TriIndexable[M]){ def get(a:a,b:b,c:c)={ ev.get(tri)(a、b、c) } } 隐式类TupleIntinIndexableOps[D,M[]]( val tri:M[D] )(隐式ev:TupleIntinIndexable[M]){ def get(a:(Int,Int,Int))={ ev.get(tri)(a) } } val测试:TriIntMap[String]=newtrimap[Int,Int,Int,String]() 测试。获取(5,5,5) 测试。获取((5,5,5)),scala,Scala,方法get的参数不足:(a:Int,b:Int,c:Int):Unit。 未指定的值参数b、c 为什么在最后一行出现此错误?我试图让TriMaps的子集能够与另一个对象建立索引,在本例中,它是三个整数的元组。我怎样才能解决这个问题 例如,您可以重命名get方法之一,或者将tuple和regular方法放入同一隐式类中。另外

方法get的参数不足:(a:Int,b:Int,c:Int):Unit。 未指定的值参数b、c

为什么在最后一行出现此错误?我试图让TriMaps的子集能够与另一个对象建立索引,在本例中,它是三个整数的元组。我怎样才能解决这个问题


例如,您可以重命名
get
方法之一,或者将tuple和regular方法放入同一隐式类中。另外