diff options
| author | gingerBill <bill@gingerbill.org> | 2018-08-16 00:07:26 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-08-16 00:07:26 +0100 |
| commit | 85ac95f81be8632c3fa3584f67714337181003de (patch) | |
| tree | c2e34e536d284d1bf7602b53c1a0fa78421a6d55 /examples | |
| parent | 042550cf87048d0a05c1de8caec4e59a280b4270 (diff) | |
Constant evaluation for `in` expression for `bit_set`s
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/demo/demo.odin | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index acedd253b..8e95aefc4 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -727,7 +727,7 @@ bit_set_type :: proc() { WEEKEND :: Days{Sunday, Saturday}; d: Days; - d = Days{Sunday} | Days{Monday}; + d = {Sunday, Monday}; x := Tuesday; e := d | WEEKEND; e |= {Monday}; @@ -738,6 +738,8 @@ bit_set_type :: proc() { if Saturday in e { fmt.println("Saturday in", e); } + X :: Saturday in WEEKEND; // Constant evaluation + fmt.println(X); } main :: proc() { |