mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 19:32:23 -07:00
Allow opaque to be polymorphic
This commit is contained in:
+7
-1
@@ -1127,7 +1127,8 @@ bool is_type_polymorphic(Type *t) {
|
||||
|
||||
case Type_Named:
|
||||
return is_type_polymorphic(t->Named.base);
|
||||
|
||||
case Type_Opaque:
|
||||
return is_type_polymorphic(t->Opaque.elem);
|
||||
case Type_Pointer:
|
||||
return is_type_polymorphic(t->Pointer.elem);
|
||||
case Type_Array:
|
||||
@@ -2571,6 +2572,11 @@ gbString write_type_to_string(gbString str, Type *type) {
|
||||
str = write_type_to_string(str, type->Pointer.elem);
|
||||
break;
|
||||
|
||||
case Type_Opaque:
|
||||
str = gb_string_appendc(str, "opaque ");
|
||||
str = write_type_to_string(str, type->Opaque.elem);
|
||||
break;
|
||||
|
||||
case Type_Array:
|
||||
str = gb_string_appendc(str, gb_bprintf("[%d]", cast(int)type->Array.count));
|
||||
str = write_type_to_string(str, type->Array.elem);
|
||||
|
||||
Reference in New Issue
Block a user