diff --git a/src/frontends/lean/frontend_elaborator.cpp b/src/frontends/lean/frontend_elaborator.cpp index 3511aae19..aecf24296 100644 --- a/src/frontends/lean/frontend_elaborator.cpp +++ b/src/frontends/lean/frontend_elaborator.cpp @@ -197,7 +197,8 @@ class frontend_elaborator::imp { /** \brief Create a metavariable for representing the choice. */ - expr mk_overload_mvar(buffer const & f_choices, context const & ctx, expr const & src) { + expr mk_overload_mvar(buffer & f_choices, context const & ctx, expr const & src) { + std::reverse(f_choices.begin(), f_choices.end()); expr mvar = m_ref.m_menv.mk_metavar(ctx); m_ref.m_ucs.push_back(mk_choice_constraint(ctx, mvar, f_choices.size(), f_choices.data(), mk_overload_justification(ctx, src))); diff --git a/tests/lean/arith1.lean.expected.out b/tests/lean/arith1.lean.expected.out index eeee998d8..55960cd13 100644 --- a/tests/lean/arith1.lean.expected.out +++ b/tests/lean/arith1.lean.expected.out @@ -14,6 +14,6 @@ n + x + m Set: lean::pp::coercion (nat_to_int n) + x + (nat_to_int m) + (nat_to_int 10) x + (nat_to_int n) + (nat_to_int m) + (nat_to_int 10) -(nat_to_int (n + m + 10)) + x +(nat_to_int n) + (nat_to_int m) + (nat_to_int 10) + x Set: lean::pp::notation -Int::add (nat_to_int (Nat::add (Nat::add n m) 10)) x +Int::add (Int::add (Int::add (nat_to_int n) (nat_to_int m)) (nat_to_int 10)) x diff --git a/tests/lean/cast3.lean.expected.out b/tests/lean/cast3.lean.expected.out index 024a3389d..e8b99396e 100644 --- a/tests/lean/cast3.lean.expected.out +++ b/tests/lean/cast3.lean.expected.out @@ -6,7 +6,7 @@ Assumed: B' Assumed: x x -⊤ +x = x Assumed: b Defined: f Assumed: H diff --git a/tests/lean/overload2.lean.expected.out b/tests/lean/overload2.lean.expected.out index 63a51c6a8..bbb07930b 100644 --- a/tests/lean/overload2.lean.expected.out +++ b/tests/lean/overload2.lean.expected.out @@ -23,10 +23,4 @@ f a b f (r2t b) (t2r a) Assumed: g f a b -Error (line: 19, pos: 10) ambiguous overloads -Candidates: - g : R → T → R - f : T → R → T -Arguments: - b : R - a : T +f (r2t b) (t2r a)