[MLton] warnUnused and recursive functions

Matthew Fluet fluet at tti-c.org
Mon Feb 26 14:46:49 PST 2007


Vesa Karvonen wrote:
> Just a quick note.  I just noticed that warnUnused doesn't seem
> to warn about recursive functions.  For example, given
> 
> local
>    fun foo () = foo () : unit
>    val bar = let fun foo () = foo () : unit in foo end
> in
> end
> 
> and -default-ann 'warnUnused true', MLton will only warn about
> bar:
> 
> Warning: unused.sml 3.8.
>   Unused variable: bar.

Hmmm.  I thought I ran into this not too long ago (in addition to the 
warnUnused and Functors that I mentioned a couple of weeks ago).  IIRC, 
it isn't difficult to catch this in the elaborator.





More information about the MLton mailing list