1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
class hierarOverload { trait AB { type TB protected trait A { val entities: List[TB] } protected trait B } object NAnB { type TB = nB type TA = nA class nA { List[nB]() } class nB {} } def foo = { val t = new NAnB.TB() } } class hierarOverload2 { object NAnB { type TB = nB class nB } def foo = { val t = new NAnB.TB() } }