Source

ocamlspot / tests / ocaml312.ml

module (* M => *) M (* <= M *) = struct
  type (* M.t => *) t (* <= M.t *) = { (* t.foo => *) foo (* <= t.foo *) : int } 
  let _ = fun (* foo1 => *) foo (* <= foo1 *) -> { foo (* ? foo1 *) (* ? M.t *) }
  let _ = fun { (* foo2 => *) foo (* <= foo2 *) (* ? M.t *) } -> foo (* ? foo2 *)
  let (* x => *) x (* <= x *) = 1
end

let _ = fun (* foo3 => *) foo (* <= foo3 *) -> { M.foo (* ? foo3 *) (* ? M.t *) }
let _ = fun { (* M.foo => *) M.foo (* <= M.foo *) (* ? M.t *) } -> foo (* ? M.foo *)
 
let f (type t) (x : t) = 
  let module N = struct
    exception E of t
  end in
  raise (N.E x)
;;

let f : 'a. 'a -> 'a = fun x -> x

(* first class packaged modules are tested in fstclassmodule.ml *)

let _ = 
  let open M (* ? M *) (* damn, no position for M *) in
  x (* ? x *)
;;

let _ = 
  M(* ? M *) . (* damn, no position for M *) (x (* ? x *))
;;

(* untested 
- method! val! inherit!
- <signature> with type t := <typeconstr>
  <signature> with module M := <module-path>
*)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.