Skip to content

Commit

Permalink
[ re #5744 ] Add some failing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jespercockx committed Jan 18, 2022
1 parent b2689af commit 382861b
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 0 deletions.
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

0 comments on commit 382861b

Please sign in to comment.