diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index 5a07a9f..5e58a45 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -1327,7 +1327,7 @@ infer_block(Env, _, [E], BlockType) -> [check_expr(Env, E, BlockType)]; infer_block(Env, Attrs, [Def={letfun, Ann, _, _, _, _}|Rest], BlockType) -> {{Name, TypeSig}, LetFun} = infer_letfun(Env, Def), - FunT = freshen_type(Ann, typesig_to_fun_t(TypeSig)), + FunT = typesig_to_fun_t(TypeSig), NewE = bind_var({id, Ann, Name}, FunT, Env), [LetFun|infer_block(NewE, Attrs, Rest, BlockType)]; infer_block(Env, _, [{letval, Attrs, Pattern, Type, E}|Rest], BlockType) -> diff --git a/test/contracts/local_poly_fail.aes b/test/contracts/local_poly_fail.aes new file mode 100644 index 0000000..189ab23 --- /dev/null +++ b/test/contracts/local_poly_fail.aes @@ -0,0 +1,7 @@ + +contract Fail = + + entrypoint tttt() : bool * int = + let f(x : 'a) : 'a = x + (f(true), f(1)) +