caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] strange typechecking result
@ 2013-02-22 17:50 Matej Kosik
  2013-02-22 18:33 ` Leo White
  0 siblings, 1 reply; 5+ messages in thread
From: Matej Kosik @ 2013-02-22 17:50 UTC (permalink / raw)
  To: OCaml

Hello,

For one of my modules, the typechecker started to raise strange 
complaints. I was not able to figure out exactly why, but at least I 
wanted to narrow down the problem.

This small program:

   type r1 = {l1 : unit list}

   and r2 = {l2 : int64 list}

   let rec f1 _ =
     ()

   and _ r1 =
     f1 r1.l1

   and _ r2 =
     f1 r2.l2

is rejected by the typechecker with a following error message:

   File "test.ml", line 12, characters 5-10:
   Error: This expression has type int64 list
          but an expression was expected of type unit list

I do not understand why the given program was rejected.

Thanks in advance for any help.
--
Matej Kosik

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-22 23:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 17:50 [Caml-list] strange typechecking result Matej Kosik
2013-02-22 18:33 ` Leo White
2013-02-22 20:14   ` Matej Kosik
2013-02-22 21:06     ` Leo White
2013-02-22 23:09       ` Jeff Meister

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).