File: index_objects.ml

package info (click to toggle)
ocaml 5.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,372 kB
  • sloc: ml: 370,196; ansic: 52,820; sh: 27,396; asm: 5,462; makefile: 3,679; python: 974; awk: 278; javascript: 273; perl: 59; fortran: 21; cs: 9
file content (49 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(* TEST

flags = "-bin-annot -bin-annot-occurrences";
compile_only = "true";
readonly_files = "index_objects.ml";
setup-ocamlc.byte-build-env;
all_modules = "index_objects.ml";
ocamlc.byte;
check-ocamlc.byte-output;

program = "-quiet -index -decls index_objects.cmt";
output = "out_objinfo";
ocamlobjinfo;

check-program-output;
*)

let o = object
  method pop () = ()
end

(* FIXME: method usages are not indexed yet *)
let () = o#pop ()

class c = object
  method cpop () = ()
end

let _ : c = new c

class d = object
  inherit c
end

module type M = sig
  class ct : object
      method pop : unit
    end

  class dt : object inherit ct end
end

class ins_var = object (self)
  val mutable ins = 0
  method get_ins () = ins
  method set_ins i = ins <- i
  method other () = self#get_ins ()
  method update = {< ins = 3 >}
end