Case class constructor argument type depending on the previous argument value
问题 I am trying to do the following trait Stateful { type State } case class SystemState(system: Stateful, state: system.State) // does not compile That is, the type of state depends on (the value of) system . That, however, is not supported: illegal dependent method type: parameter appears in the type of another parameter in the same section or an earlier one With function arguments, I could split the arguments into two argument lists, which is not possible with a case class constructor: def f