Scala: abstracting over a path-dependent type in impilicit parameter
问题 Let's say I have a class: abstract class NumericCombine[A:Numeric,B:Numeric]{ type AB <: AnyVal } I want to define a function that returns a value of type NumericCombine[A,B].AB . for instance: def plus[A: Numeric,B:Numeric](x: A, y: B): NumericCombine[A,B].AB but the compiler doesn't let me reference .AB in plus. FYI, this is the context of this question. I want to provide: implicit object IntFloat extends NumericCombine[Int,Float]{override type AB = Float} implicit object FloatInt extends