diff options
| author | Alasdair Armstrong | 2017-08-22 17:20:29 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-08-22 17:20:29 +0100 |
| commit | 0f9ca620299613caf186eabf1e8cb9a83c6e2d0e (patch) | |
| tree | c24c36404c892046634463a1b88480206cf76e6c /test/typecheck | |
| parent | b1b1c2a5e99887625ce98e2842ce20129475589f (diff) | |
Added basic support for pure record definitions and functional record
updates to the new typechecker
Diffstat (limited to 'test/typecheck')
| -rw-r--r-- | test/typecheck/pass/pure_record.sail | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/typecheck/pass/pure_record.sail b/test/typecheck/pass/pure_record.sail new file mode 100644 index 00000000..c7bc373a --- /dev/null +++ b/test/typecheck/pass/pure_record.sail @@ -0,0 +1,22 @@ +default Order dec + +typedef State = const struct forall Type 'a. { + vector<0, 1, dec, 'a> N; + vector<0, 1, dec, bit> Z; +} + +let (State<bit>) myStateM = { + (State<bit>) r := undefined; + r.N := 0b1; + r.Z := 0b1; + r +} + +let (State<bit>) myState = { N = 0b1; Z = 0b1 } + +val unit -> unit effect {undef} test + +function test () = { + (State<bit>) myState2 := { N = undefined; Z = 0b1 }; + (State<bit>) myState3 := { myState2 with N = 0b0 } +} |
