diff --git a/src/aeso_ast_to_fcode.erl b/src/aeso_ast_to_fcode.erl index ccc4baa..c432ef8 100644 --- a/src/aeso_ast_to_fcode.erl +++ b/src/aeso_ast_to_fcode.erl @@ -376,7 +376,8 @@ expr_to_fcode(Env, _Type, {app, _Ann, Fun, Args}) -> expr_to_fcode(_Env, Type, Expr) -> error({todo, {Expr, ':', Type}}). -binop_to_fcode(Op) when Op == '+'; Op == '-'; Op == '==' -> Op. +binop_to_fcode(Op) when Op == '+'; Op == '-'; Op == '=='; + Op == '::' -> Op. -spec alts_to_fcode(env(), ftype(), var_name(), [aeso_syntax:alt()]) -> fsplit(). alts_to_fcode(Env, Type, X, Alts) -> diff --git a/src/aeso_fcode_to_fate.erl b/src/aeso_fcode_to_fate.erl index 6808586..f94982f 100644 --- a/src/aeso_fcode_to_fate.erl +++ b/src/aeso_fcode_to_fate.erl @@ -216,7 +216,8 @@ to_scode(_Env, {oracle_query_id, K}) -> %% Not actually in FATE yet [push(?i(aeb_fate_data:make_oracle_query(K)))]; -to_scode(_Env, nil) -> aeb_fate_code:nil(?a); +to_scode(_Env, nil) -> + [aeb_fate_code:nil(?a)]; to_scode(Env, {var, X}) -> [push(lookup_var(Env, X))]; @@ -882,7 +883,12 @@ r_prune_impossible_branches({switch, ?i(V), boolean, [False, True] = Alts, Def}, r_prune_impossible_branches(Variant = {i, _, {'VARIANT', R, ?i(_), ?i(Tag), ?i(_)}}, [{switch, R, Type, Alts, missing} | Code]) -> case {R, lists:nth(Tag + 1, Alts)} of - {_, missing} -> {[Variant, {switch, R, Type, [missing || _ <- Alts], missing}]}; + {_, missing} -> + Alts1 = [missing || _ <- Alts], + case Alts == Alts1 of + true -> false; + false -> {[Variant, {switch, R, Type, Alts1, missing}], Code} + end; {?a, Alt} -> {Alt, Code}; {_, Alt} -> case live_in(R, Alt) of