blob: d0a830d806d62bff73c8e08ac0a96183ab870820 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
(* TEST
expect;
*)
type bar = < bar: unit >
type _ ty = Int : int ty
type dyn = Dyn : 'a ty -> dyn;;
class foo =
object (this)
method foo (Dyn ty) =
match ty with
| Int -> (this :> bar)
end;; (* fail, but not for scope *)
[%%expect{|
type bar = < bar : unit >
type _ ty = Int : int ty
type dyn = Dyn : 'a ty -> dyn
Lines 8-12, characters 2-5:
8 | ..object (this)
9 | method foo (Dyn ty) =
10 | match ty with
11 | | Int -> (this :> bar)
12 | end.................................
Error: This non-virtual class has undeclared virtual methods.
The following methods were not declared : bar
|}];;
|