Skip to content

Commit

Permalink
Add absurd conversion test
Browse files Browse the repository at this point in the history
  • Loading branch information
ollef committed May 12, 2024
1 parent 09b7aa6 commit d02a97c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/singles/type-checking/absurd-conversion.vix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
data Empty where

data Bool = False | True

absurd : Empty -> Bool
absurd e = case e of

data Equals forall A. (a b : A) where
Refl : Equals a a

trans : forall A (a b c : A). Equals a b -> Equals b c -> Equals a c
trans Refl Refl = Refl

sym : forall A (a b : A). Equals a b -> Equals b a
sym Refl = Refl

lol1 : (e : Empty) -> Equals (absurd e) True
lol1 e = Refl

lol2 : (e : Empty) -> Equals (absurd e) False
lol2 e = Refl

lol3 : Empty -> Equals True False
lol3 e = Refl -- type mismatch error expected

lol4 : Empty -> Equals True False
lol4 e = case e of

lol5 : Empty -> Equals True False
lol5 e = trans (sym (lol1 e)) (lol2 e)

0 comments on commit d02a97c

Please sign in to comment.