Fix missing type annotation in list comprehension body
This commit is contained in:
parent
64e2fff91a
commit
d844c4d276
@ -1138,7 +1138,7 @@ infer_expr(Env, {list, As, Elems}) ->
|
|||||||
NewElems = [check_expr(Env, X, ElemType) || X <- Elems],
|
NewElems = [check_expr(Env, X, ElemType) || X <- Elems],
|
||||||
{typed, As, {list, As, NewElems}, {app_t, As, {id, As, "list"}, [ElemType]}};
|
{typed, As, {list, As, NewElems}, {app_t, As, {id, As, "list"}, [ElemType]}};
|
||||||
infer_expr(Env, {list_comp, As, Yield, []}) ->
|
infer_expr(Env, {list_comp, As, Yield, []}) ->
|
||||||
{typed, _, TypedYield, Type} = infer_expr(Env, Yield),
|
{typed, _, _, Type} = TypedYield = infer_expr(Env, Yield),
|
||||||
{typed, As, {list_comp, As, TypedYield, []}, {app_t, As, {id, As, "list"}, [Type]}};
|
{typed, As, {list_comp, As, TypedYield, []}, {app_t, As, {id, As, "list"}, [Type]}};
|
||||||
infer_expr(Env, {list_comp, As, Yield, [{comprehension_bind, Arg, BExpr}|Rest]}) ->
|
infer_expr(Env, {list_comp, As, Yield, [{comprehension_bind, Arg, BExpr}|Rest]}) ->
|
||||||
BindVarType = fresh_uvar(As),
|
BindVarType = fresh_uvar(As),
|
||||||
|
@ -138,6 +138,7 @@ compilable_contracts() ->
|
|||||||
"test",
|
"test",
|
||||||
"builtin_bug",
|
"builtin_bug",
|
||||||
"builtin_map_get_bug",
|
"builtin_map_get_bug",
|
||||||
|
"lc_record_bug",
|
||||||
"nodeadcode",
|
"nodeadcode",
|
||||||
"deadcode",
|
"deadcode",
|
||||||
"variant_types",
|
"variant_types",
|
||||||
|
4
test/contracts/lc_record_bug.aes
Normal file
4
test/contracts/lc_record_bug.aes
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
contract Foo =
|
||||||
|
record r = {x : int}
|
||||||
|
// Crashed in the backend due to missing type annotation on the lc body.
|
||||||
|
entrypoint lc(xs) = [ {x = x} | x <- xs ]
|
Loading…
x
Reference in New Issue
Block a user