caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] typechecking
@ 2014-03-22 20:02 Misha Aizatulin
  2014-03-22 20:40 ` Daniel Bünzli
  2014-03-23  4:41 ` oleg
  0 siblings, 2 replies; 7+ messages in thread
From: Misha Aizatulin @ 2014-03-22 20:02 UTC (permalink / raw)
  To: caml-list


  Using ocaml 4.00.1 the program below successfully compiles. I think
this should be rejected because the call (f t) forces t to be of type t2
whereas the annotation on input function requires it to be of type t1.

type t1 = T1
type t2 = T2

let f T2 = ()

let input (c : in_channel) : t1 =
  let t = input_value c in
  f t;
  t

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

end of thread, other threads:[~2014-03-24  8:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-22 20:02 [Caml-list] typechecking Misha Aizatulin
2014-03-22 20:40 ` Daniel Bünzli
2014-03-22 22:12   ` Yaron Minsky
2014-03-22 22:24     ` Jonathan Protzenko
2014-03-23  4:41 ` oleg
2014-03-23 12:59   ` Jacques Garrigue
2014-03-24  8:46     ` Alain Frisch

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).