aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-12-22 12:03:48 +0000
committergingerBill <bill@gingerbill.org>2019-12-22 12:03:48 +0000
commitd1c9fd4e012e16cee73e9ef0af716caf34430d81 (patch)
tree048a9dd6ed2294d685761e31081620a924ee6ef9 /core/runtime
parent45937306321df28266c793b7225eb10ad3d741e2 (diff)
Implement `#complete switch` by default, replace with `#partial switch` #511
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/core.odin4
-rw-r--r--core/runtime/internal.odin7
2 files changed, 7 insertions, 4 deletions
diff --git a/core/runtime/core.odin b/core/runtime/core.odin
index 340267497..f9ffbdd62 100644
--- a/core/runtime/core.odin
+++ b/core/runtime/core.odin
@@ -305,7 +305,7 @@ type_info_base :: proc "contextless" (info: ^Type_Info) -> ^Type_Info {
base := info;
loop: for {
- switch i in base.variant {
+ #partial switch i in base.variant {
case Type_Info_Named: base = i.base;
case: break loop;
}
@@ -319,7 +319,7 @@ type_info_core :: proc "contextless" (info: ^Type_Info) -> ^Type_Info {
base := info;
loop: for {
- switch i in base.variant {
+ #partial switch i in base.variant {
case Type_Info_Named: base = i.base;
case Type_Info_Enum: base = i.base;
case Type_Info_Opaque: base = i.elem;
diff --git a/core/runtime/internal.odin b/core/runtime/internal.odin
index d377c7bd0..3226a774b 100644
--- a/core/runtime/internal.odin
+++ b/core/runtime/internal.odin
@@ -110,6 +110,9 @@ print_type :: proc(fd: os.Handle, ti: ^Type_Info) {
case Type_Info_Complex:
os.write_string(fd, "complex");
print_u64(fd, u64(8*ti.size));
+ case Type_Info_Quaternion:
+ os.write_string(fd, "quaternion");
+ print_u64(fd, u64(8*ti.size));
case Type_Info_String:
os.write_string(fd, "string");
case Type_Info_Boolean:
@@ -183,7 +186,7 @@ print_type :: proc(fd: os.Handle, ti: ^Type_Info) {
print_type(fd, info.value);
case Type_Info_Struct:
- #complete switch info.soa_kind {
+ switch info.soa_kind {
case .None: // Ignore
case .Fixed:
os.write_string(fd, "#soa[");
@@ -263,7 +266,7 @@ print_type :: proc(fd: os.Handle, ti: ^Type_Info) {
case Type_Info_Bit_Set:
os.write_string(fd, "bit_set[");
- switch elem in type_info_base(info.elem).variant {
+ #partial switch elem in type_info_base(info.elem).variant {
case Type_Info_Enum:
print_type(fd, info.elem);
case Type_Info_Rune: