fork download
  1. object Main extends App {
  2. trait Q {
  3. type C
  4. val x: C
  5. }
  6.  
  7. class R[T <: Q](obj: T) {
  8. val x: T#C = obj.x
  9. println(x)
  10. }
  11.  
  12. new R(new Q {
  13. type C = Int
  14. val x = 11
  15. })
  16. }
Success #stdin #stdout 0.37s 382080KB
stdin
Standard input is empty
stdout
11