on master help sign in
Add erasure postulates for unsafePerformPrimIO.
17ff3b5Matus Tejiscak
src/Idris/Erasure.hs+1
@@ -203,6 +203,7 @@ buildDepMap ci ctx mainName = addPostulates $ dfs S.empty M.empty [mainName]
203 -- among Idris.Primitives.primitives
203 -- among Idris.Primitives.primitives
204 , mn "__MkPair" [2,3]
204 , mn "__MkPair" [2,3]
205 , it "prim_fork" [0]
205 , it "prim_fork" [0]
206+ , it "unsafePerformPrimIO" [1]
206
207
207 -- believe_me is a primitive but it only uses its third argument
208 -- believe_me is a primitive but it only uses its third argument
208 -- it is special-cased in usedNames above
209 -- it is special-cased in usedNames above
test/reg040/expectednew file+1
@@ -0,0 +1 @@
1+42
test/reg040/reg040.idrnew file+7
@@ -0,0 +1,7 @@
1+-- The regression that this tests for is defunct unsafePerformIO
2+
3+io : IO Int
4+io = return 42
5+
6+main : IO ()
7+main = print $ unsafePerformIO io
test/reg040/runnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/env bash
2+
3+idris --warnreach reg040.idr -o reg040
4+./reg040
5+
6+rm -f reg040 *.ibc