@@ -0,0 +1,24 @@
1+-- This regtest tests for incorrect erasure from underapplied data constructors.
4+ C : Nat -> Nat -> Nat -> T
9+-- The bug was here: (C 3 4) would compile to plain data,
10+-- not to a function that would expect another (albeit erased) argument.
14+proj : Nat -> Q -> Nat -> T
16+proj (S n) q = proj n q
21+-- Here, we'd apply the not-a-function to the erased argument 4,
22+-- which would make the program go wrong.
24+main = print $ g (proj 3 f 4)