[MLton] Bug in monomorphise(?)

Matthew Fluet fluet at tti-c.org
Fri Jul 6 15:38:06 PDT 2007


I've checked in a fix to the monomorphise pass.  AFAICT, this bug has been 
latent since the original mlton-19990319 release!  The commit message has 
more details for those interested:
   http://mlton.org/pipermail/mlton-commit/2007-July/001733.html

> Confirmed.  I probably won't get a chance to look at this until the end of 
> the week.  But, the fact that all of the xml passes type-check does point to 
> a bug in monomorphise.
>
>>  Attempt to compile the program (which uses stuff from mltonlib)
>>
>>  (* <--- test.mlb *)
>>  local
>>    $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb
>>    $(MLTON_LIB)/com/ssh/generic/unstable/lib-with-default.mlb
>>
>>  test.sml
>>  in
>>  end
>>  (* ---> *)
>>
>>  (* <--- test.sml *)
>>  val () = let
>>  open Generic
>>  in
>>    app (println o Word.toString o hash largeInt)
>>        [12345678910,
>>         12345678911,
>>         11987654321]
>>  end
>>  (* ---> *)
>>
>>  with latest MLton from the trunk, produces the following compiler
>>  output (-verbose 2 -type-check true):
>>
>>  MLton starting
>>  MLton MLTONVERSION (built Tue Jul 03 22:53:10 2007 on grape)
>>     monomorphise starting
>>     monomorphise finished in 0.26 + 0.23 (47% GC)
>>     typeCheck starting
>>  	    typeCheck starting
>>  Type error: type mismatch
>>  (list_0 * Sum.sum_0 -> bool * Lazy.status_0 ref ref)
>>  * (WithTypeInfo.s_0
>>    * ((Sum.sum_0 * Sum.sum_0 -> bool)
>>       * ((Sum.sum_0 * Sum.sum_0 -> Primitive.Order.t_0)
>>     * ((unit -> Sum.sum_0)
>>        * ((Sum.sum_0 * Sum.sum_0 -> bool)
>>           * ((Sum.sum_0 * Sum.sum_0 -> Primitive.Order.t_0)
>>       * ((unit -> Sum.sum_0)
>>          * (WithArbitrary.t_0
>>      * ((Sum.sum_0 -> word32 * word32 -> word32 ->
>>      word32)
>>  			   * unit)))))))))
>>  ->  word32
>>  (list_0 * Sum.sum_0 -> bool * Lazy.status_0 ref ref)
>>  * (WithTypeInfo.s_0
>>    * ((Sum.sum_0 * Sum.sum_0 -> bool)
>>       * ((Sum.sum_0 * Sum.sum_0 -> Primitive.Order.t_0)
>>     * ((unit -> Sum.sum_0)
>>        * (WithArbitrary.t_0
>>          * ((Sum.sum_0 -> word32 * word32 -> word32 -> word32) *
>>  unit))))))
>>  ->  word32
>>  val x_0 =
>>  x_1
>>  val x_0 =
>>   x_1
>
> _______________________________________________
> MLton mailing list
> MLton at mlton.org
> http://mlton.org/mailman/listinfo/mlton
>



More information about the MLton mailing list