diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-02-14 16:37:24 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-02-14 16:37:24 +0000 |
| commit | 8b5e3428a1e569abf763e63e859754e767e107e7 (patch) | |
| tree | 302a0cd18b18436feeac7bf50d0d430b0368251a /code | |
| parent | d1f65097c48afe6d869949cc5ede76a8b14401a9 (diff) | |
Optional ok for `union_cast` (similar to map indices)
Diffstat (limited to 'code')
| -rw-r--r-- | code/demo.odin | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/code/demo.odin b/code/demo.odin index caee21a05..a2049654c 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -2,6 +2,12 @@ main :: proc() { + x := type_info(int); + t1, ok := union_cast(^Type_Info.Integer)x; + _, ok = union_cast(^Type_Info.Integer)x; + t2 := union_cast(^Type_Info.Integer)x; + + /* /* Version 0.1.1 @@ -17,7 +23,7 @@ main :: proc() { * Entities prefixes with an underscore do not get exported on imports * Overloaded `free` for pointers, slices, strings, dynamic arrays, and dynamic maps * enum types have an implict `names` field, a []string of all the names in that enum - * immutable variables are "completely immutable" + * immutable variables are "completely immutable" - rules need a full explanation * `slice_to_bytes` - convert any slice to a slice of bytes Removed: |