forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/- | ||
Copyright (c) 2021 Gabriel Ebner. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Author: Gabriel Ebner | ||
-/ | ||
import Lean | ||
|
||
open Lean Elab Term | ||
|
||
/-! | ||
Redefine the ↑-notation to elaborate in the same way as type annotations | ||
(i.e., unfolding the coercion instance). | ||
-/ | ||
|
||
namespace Lean.Elab.Term.CoeImpl | ||
|
||
scoped elab "coe%" x:term : term <= expectedType => do | ||
tryPostponeIfMVar expectedType | ||
let x ← elabTerm x none | ||
synthesizeSyntheticMVarsUsingDefault | ||
ensureHasType expectedType x | ||
|
||
macro_rules | ||
| `(↑ $x) => `(coe% $x) |