<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/6d74997bb1fe66bddfac5a3b8d983d78"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T14:10:31"
  subject="Re: [Caml-list] Warning wished"
  prev="2009/01/aea937f8b99b3256c78e9bc52e2c299e"
  next="2009/01/35bc1c0863a6ee8290aadf88f8fe0ae7"
  prev-in-thread="2009/01/4ec57fa817e7ef6cf9c31bb4deed5536"
  next-in-thread="2009/01/45953a20270735445c964bb67f8ea92e"
  prev-thread="2009/01/ec5abc48403b5e7647c7a58e6fcf15a5"
  next-thread="2009/01/4e3033b888ae0f626c14906f241d690a"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Warning wished">
<msg 
  url="2009/01/7bbb57f36284fe4ff07085af2e385261"
  from="Julien SIGNOLES &lt;julien.signoles@c...&gt;"
  author="Julien SIGNOLES"
  date="2009-01-28T13:52:48"
  subject="Warning wished">
<msg 
  url="2009/01/aea937f8b99b3256c78e9bc52e2c299e"
  from="Matthieu Wipliez &lt;mwipliez@y...&gt;"
  author="Matthieu Wipliez"
  date="2009-01-28T14:07:23"
  subject="Re : [Caml-list] Warning wished">
<msg 
  url="2009/01/35bc1c0863a6ee8290aadf88f8fe0ae7"
  from="Julien SIGNOLES &lt;julien.signoles@c...&gt;"
  author="Julien SIGNOLES"
  date="2009-01-28T14:23:13"
  subject="Re: Re : [Caml-list] Warning wished">
<msg 
  url="2009/01/4ec57fa817e7ef6cf9c31bb4deed5536"
  from="Nicolas Pouillard &lt;nicolas.pouillard@g...&gt;"
  author="Nicolas Pouillard"
  date="2009-01-28T20:57:16"
  subject="Re: Re : [Caml-list] Warning wished">
</msg>
</msg>
</msg>
<msg 
  url="2009/01/6d74997bb1fe66bddfac5a3b8d983d78"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T14:10:31"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/45953a20270735445c964bb67f8ea92e"
  from="Julien SIGNOLES &lt;julien.signoles@c...&gt;"
  author="Julien SIGNOLES"
  date="2009-01-28T14:27:15"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/ee440040904926febe34eb8fd7af3f0c"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T14:44:23"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/dcfa3c89152151c40d42837f02268c1e"
  from="Frédéric_van_der_Plancke &lt;fvdp@d...&gt;"
  author="Frédéric_van_der_Plancke"
  date="2009-01-28T18:29:49"
  subject="Re: [Caml-list] Warning wished">
<msg 
  url="2009/01/f5569cbcdc3e54b49c67f5f1b64a0812"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-28T19:08:40"
  subject="Re: [Caml-list] Warning wished">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2009/01/5b1dcaf779bdc8831935101571c8421d"
  from="Martin Jambon &lt;martin.jambon@e...&gt;"
  author="Martin Jambon"
  date="2009-01-28T16:57:12"
  subject="Re: [Caml-list] Warning wished">
</msg>
</msg>
</thread>

<contents>
    Hello Julien,

    no warning should be issued in this case since you have polymorphic 
function:
applying g to () you will definitely have f x of type unit :)
    Try another one:

    let f x = x+1
    let g x = f x; 1

    Now you'll get the warning since the compiler can ensure that type 
of  f x can never
be unit.

    Best regards,
    Dmitry.


&gt; Hello,
&gt;
&gt; Is it a bug or a well-known feature that the above program does not emit
&gt; a warning (because "f x" should have type unit in the body of "g") ?
&gt;
&gt; =====
&gt; let f x = x
&gt; let g x = f x; 1
&gt; (* let _ = g 2 *)
&gt; ====
&gt;
&gt; Best regards,
&gt; Julien Signoles
&gt;
&gt; _______________________________________________
&gt; Caml-list mailing list. Subscription management:
&gt; http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
&gt; Archives: http://caml.inria.fr
&gt; Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
&gt; Bug reports: http://caml.inria.fr/bin/caml-bugs
&gt;
&gt;   

</contents>

</message>

