From 8ac4156c8795c730b3f96f95dca73624289b9808 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 18 Aug 2021 13:50:43 +0300 Subject: [PATCH] Implement mk_error for ambiguous_name --- src/aeso_ast_infer_types.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index f1397ca..74dd14b 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -3019,6 +3019,10 @@ mk_error({contract_lacks_definition, Type, When}) -> ), {Pos, Ctxt} = pp_when(When), mk_t_err(Pos, Msg, Ctxt); +mk_error({ambiguous_name, QIds = [{qid, Ann, _} | _]}) -> + Names = lists:map(fun(QId) -> io_lib:format("~s at ~s\n", [pp(QId), pp_loc(QId)]) end, QIds), + Msg = "Ambiguous name: " ++ lists:concat(Names), + mk_t_err(pos(Ann), Msg); mk_error(Err) -> Msg = io_lib:format("Unknown error: ~p\n", [Err]), mk_t_err(pos(0, 0), Msg).