Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TTImp/ProcessRecord.idr
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ elabRecord {vars} eopts fc env nest newns vis mbtot tn_in params0 opts conName_i

let mkProjClaim = \ nm =>
let ty = MkImpTy EmptyFC EmptyFC nm projTy
in IClaim bfc rig isVis [Inline] ty
in IClaim bfc rig isVis [Inline, TCInline] ty

log "declare.record.projection" 5 $
"Projection " ++ show rfNameNS ++ " : " ++ show projTy
Expand Down
2 changes: 1 addition & 1 deletion tests/Main.idr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ yaffleTests = MkTestPool "Yaffle" [] Nothing
"compile001", "compile002",
"coverage001",
"qtt001", "qtt002", "qtt003", "qtt004",
"record001", "record002",
"record001", "record002", "record003",
"rewrite001",
"with001",
-- Below are things that don't test anything specific, but are useful exercises
Expand Down
22 changes: 22 additions & 0 deletions tests/yaffle/record003/Record.yaff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
data Unit : Type where
MkUnit : Unit

record Id a where
constructor MkId
field : a

data X : Type where
Stop : Unit -> X
Cont : Id X -> X

f : X -> Unit
f (Stop n) = n
f (Cont x) = f (field x)

field' : Id a -> a
field' x = case x of
MkId y => y

f' : X -> Unit
f' (Stop n) = n
f' (Cont x) = f' (field' x)
7 changes: 7 additions & 0 deletions tests/yaffle/record003/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Processing as TTImp
Written TTC
Yaffle> Main.MkUnit
Yaffle> Main.f is total
Yaffle> Main.MkUnit
Yaffle> Main.f' is total
Yaffle> Bye for now!
5 changes: 5 additions & 0 deletions tests/yaffle/record003/input
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
f (Stop MkUnit)
:total f
f' (Stop MkUnit)
:total f'
:q
3 changes: 3 additions & 0 deletions tests/yaffle/record003/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm -rf build
$1 --yaffle Record.yaff < input