Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running of erased macros #5744

Merged
merged 4 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[ re #5744 ] Add some failing test cases
  • Loading branch information
jespercockx committed Jan 17, 2022
commit bac7818c0ccf8104874b8d123e3fc8003df2ef9e
15 changes: 15 additions & 0 deletions test/Fail/ErasedMacro1.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit

@0 A : Set₁
A = Set

macro

@0 m : Term → TC ⊤
m B =
bindTC (quoteTC A) λ A →
unify A B

B : Set₁
B = m
3 changes: 3 additions & 0 deletions test/Fail/ErasedMacro1.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ErasedMacro1.agda:15,5-6
Identifier A is declared erased, so it cannot be used here
when inferring the type of A
12 changes: 12 additions & 0 deletions test/Fail/ErasedMacro2.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit

macro

@0 m : @0 Set → Term → TC ⊤
m A B =
bindTC (quoteTC A) λ A →
unify A B

F : @0 Set → Set
F A = m A
3 changes: 3 additions & 0 deletions test/Fail/ErasedMacro2.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ErasedMacro2.agda:12,7-10
Variable A is declared erased, so it cannot be used here
when inferring the type of A
12 changes: 12 additions & 0 deletions test/Fail/ErasedMacro3.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit

macro

@0 m : Set → Term → TC ⊤
m A B =
bindTC (quoteTC A) λ A →
unify A B

F : @0 Set → Set
F A = m A
3 changes: 3 additions & 0 deletions test/Fail/ErasedMacro3.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ErasedMacro3.agda:12,7-10
Variable A is declared erased, so it cannot be used here
when inferring the type of A
19 changes: 19 additions & 0 deletions test/Fail/ErasedMacro4.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Sigma
open import Agda.Builtin.Unit

@0 m : Name → TC ⊤
m F = defineFun F
(clause
(( "A"
, arg (arg-info visible (modality relevant quantity-0))
(agda-sort (lit 0))) ∷
[])
(arg (arg-info visible (modality relevant quantity-0)) (var 0) ∷
[])
(var 0 []) ∷
[])

F : @0 Set → Set
unquoteDef F = m F
3 changes: 3 additions & 0 deletions test/Fail/ErasedMacro4.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ErasedMacro4.agda:19,1-19
Variable A is declared erased, so it cannot be used here
when checking that the expression A has type Set