Add a test for non linear LHS

This commit is contained in:
Edwin Brady 2019-05-19 20:30:27 +01:00
parent 8081b0374a
commit d256dbf5ec
5 changed files with 20 additions and 1 deletions

View File

@ -11,7 +11,7 @@ ttimpTests
"eta001", "eta002",
"nest001", "nest002",
"perf001", "perf002", "perf003",
"qtt001", "qtt002"]
"qtt001", "qtt002", "qtt003"]
chdir : String -> IO Bool
chdir dir

View File

@ -0,0 +1,8 @@
data Eq : $a -> $b -> Type where
Refl : Eq $x $x
okay : {p : $a -> $b} -> (1 x : $a) -> (1 y : $a) -> (1 prf : Eq x y) ->
p x -> p y
-- Should fail on the LHS, before even getting to the RHS, because
-- after elaboration 'x' appears twice even though it is linearly bound.
okay _ $x Refl $q = q

View File

@ -0,0 +1,3 @@
Processing as TTImp
QTTEq.yaff:8:1--9:1:There are 2 uses of linear name x
Yaffle> Yaffle> Yaffle> Yaffle> Yaffle> Bye for now!

5
tests/ttimp/qtt003/input Normal file
View File

@ -0,0 +1,5 @@
:t foo
:t bar
:t baz1
:t baz2
:q

3
tests/ttimp/qtt003/run Executable file
View File

@ -0,0 +1,3 @@
$1 QTTEq.yaff < input
rm -rf build