Decode this bug
Daniel Wang
danwang@cs.princeton.edu
10 Dec 1999 19:37:06 -0500
So.. right now, I'm trying to use MLton as a backend. I generate a
Cps.Program.t using Cps.DirectExp and then feed it to the rest of the
system, however when I run the Cps.typechek I get the exception
Bug: reference to Cons741 not in scope
uncaught exception Bug
Here's the printed version of the Cps code. It looks like Cons741 is "in
scope" I'm not sure what to make of it... (this is the only reference to
Cons741 in the program...)
Datatypes:
lst4 = Cons7 of [(int * lst4)]
Nil6
Globals:
Functions:
fun copy_lst38(lst440: lst4): (lst4) =
let fun L_0(x_0: lst4@Cons7) =
let val Cons741: (int * lst4) = Cons7#1 x_0
val t42: (int * lst4) = Cons741
val t58: int = #2 t42
val t59: lst4 = #3 t42
val x_1: lst4 = x_1
val t60: lst4 = #2 x_1
val t61: (int * lst4) = (t58, t60)
val t62: lst4 = Cons7(t61)
in Return (t62)
end
fun L_1(x_2: lst4@Nil6) =
let val t57: lst4 = Nil6()
in Return (t57)
end
in case lst440 of
Cons7 => L_0 | Nil6 => L_1
end