Skip to content

Commit

Permalink
fix(frontends/lean/elaborator): ignore auto/default params when @ i…
Browse files Browse the repository at this point in the history
…s used

see leanprover#1485

@Kha We need this commit to be able to execute commands such as:
```lean
  #check @monad.mk
```
  • Loading branch information
leodemoura committed Mar 24, 2017
1 parent cf638f6 commit e97c934
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/frontends/lean/elaborator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1540,8 +1540,11 @@ expr elaborator::visit_base_app_simple(expr const & _fn, arg_mask amask, buffer<
type = instantiate_mvars(type_before_whnf);

buffer<expr> eta_args;
if (optional<expr> new_type = process_optional_and_auto_params(type, ref, eta_args, new_args))
type = *new_type;
if (amask == arg_mask::Default) {
/* We ignore optional/auto params when `@` is used */
if (optional<expr> new_type = process_optional_and_auto_params(type, ref, eta_args, new_args))
type = *new_type;
}

expr r = Fun(eta_args, mk_app(fn, new_args.size(), new_args.data()));
if (expected_type) {
Expand Down
3 changes: 3 additions & 0 deletions tests/lean/run/check_monad_mk.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#check @monad.mk
#check @functor.mk
#check @applicative.mk

0 comments on commit e97c934

Please sign in to comment.