import cppbase (add)
export foo
y = 40;
foo x = add x y;
Here is there error message:
: --- realize ---
: 0 foo :: Num -> Num
_ :: {double@CppLang -> double@CppLang}
LamS [x]
1 :: Num
_ :: {double@CppLang}
AppS 3 add :: Num -> Num -> Num
_ :: {double@CppLang -> double@CppLang -> double@CppLang}
CallS add <CppLang>
4 x :: Num
_ :: {double@CppLang}
VarS x
5 y :: Num <<<< should be: {double@CppLang}, not the general Num type
_ :: {}
NumS
: ---------------
OtherError: Expected GAST
The error is occurring in the makeGAST function called in the realize step of the generator algorithm. A GAST is a General Abstract Syntax Tree. The makeGAST function is called because the realize function failed to find a valid concrete realization for the function foo. The reason it could not is because y does not have a concrete type. The inference engine SHOULD have transferred the concrete type known from add's signature to y. This is a bug in the inference code (infer.hs).
The following code fails:
Here is there error message:
The error is occurring in the
makeGAST
function called in therealize
step of the generator algorithm. A GAST is a General Abstract Syntax Tree. ThemakeGAST
function is called because therealize
function failed to find a valid concrete realization for the functionfoo
. The reason it could not is becausey
does not have a concrete type. The inference engine SHOULD have transferred the concrete type known fromadd
's signature toy
. This is a bug in the inference code (infer.hs
).