forked from agda/agda
-
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.
[ fix agda#5695 ] New implementation of elaborate-and-give command (C…
…-c C-m)
- Loading branch information
1 parent
0dfef44
commit d7c6347
Showing
6 changed files
with
60 additions
and
13 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,15 @@ | ||
open import Agda.Builtin.Bool | ||
open import Agda.Builtin.List | ||
open import Agda.Builtin.Nat | ||
open import Agda.Builtin.Unit | ||
open import Agda.Builtin.Reflection | ||
|
||
macro | ||
printType : Term → TC ⊤ | ||
printType hole = bindTC (inferType hole) λ t → typeError (termErr t ∷ []) | ||
|
||
test1 : (a : Nat) → Nat | ||
test1 = {! printType !} | ||
|
||
test2 : (a : Bool) → Bool | ||
test2 = {! printType !} |
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,3 @@ | ||
top_command (cmd_load currentFile []) | ||
goal_command 0 (cmd_elaborate_give AsIs) "printType" | ||
goal_command 1 (cmd_elaborate_give AsIs) "printType" |
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,12 @@ | ||
(agda2-status-action "") | ||
(agda2-info-action "*Type-checking*" "" nil) | ||
(agda2-highlight-clear) | ||
(agda2-status-action "") | ||
(agda2-info-action "*All Goals*" "?0 : Nat → Nat ?1 : Bool → Bool " nil) | ||
((last . 1) . (agda2-goals-action '(0 1))) | ||
(agda2-info-action "*Error*" "1,1-10 (a : Nat) → Nat when checking that the expression unquote printType has type Nat → Nat" nil) | ||
(agda2-highlight-load-and-delete-action) | ||
(agda2-status-action "") | ||
(agda2-info-action "*Error*" "1,1-10 (a : Bool) → Bool when checking that the expression unquote printType has type Bool → Bool" nil) | ||
(agda2-highlight-load-and-delete-action) | ||
(agda2-status-action "") |