compiles.ml
- class c1 =
- object
- method m1 = 1
- end
- class c2 =
- object
- inherit c1
- method m2 = 2
- end
- class c3 =
- object
- method m3 (x: c1) = x#m1
- end
- let () =
- let i1 = new c1
- and i2 = new c2
- and i3 = new c3 in
- let _ = i3#m3 i1, i3#m3 (i2 :> c1)
- in ()
doesnt-compile.ml
- class c1 =
- object
- method m1 = 1
- end
- class c2 =
- object
- inherit c1
- method m2 = 2
- end
- class c3 =
- object
- method m3 (x: c1) = x#m1
- end
- let () =
- let i1 = new c1
- and i2 = new c2
- and i3 = new c3 in
- let _ = i3#m3 i1, i3#m3 i2
- in ()