Confusion about type refinement syntax
问题 On Type Level, i stumble upon the following: sealed abstract class StSource[A] { type S def init: S // create the initial state def emit(s: S): (A, S) // emit a value, and update state } object StSource { type Aux[A, S0] = StSource[A] {type S = S0} def apply[A, S0](i: S0)(f: S0 => (A, S0)): Aux[A, S0] = new StSource[A] { type S = S0 def init = i def emit(s: S0) = f(s) } } The line that intrigued me is type Aux[A, S0] = StSource[A] {type S = S0} In paerticular {type S = S0} in StSource[A]