polyclass.ml 152 Bytes
Newer Older
1 2 3 4 5 6 7 8
class ['self] c = object (_ : 'self)
  method identity (x : 'a) : 'a = x
end

let b : bool =
  new c # identity true
let i : int =
  new c # identity 0