mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-15 18:32:22 -07:00
Make the string type elements "immutable", akin to char const * in C
Allows for extra security and optimization benefits
This commit is contained in:
+6
-1
@@ -1186,7 +1186,12 @@ bool check_type_specialization_to(CheckerContext *ctx, Type *specialization, Typ
|
||||
return false;
|
||||
}
|
||||
|
||||
if (t->kind == Type_Struct) {
|
||||
if (is_type_untyped(t)) {
|
||||
Operand o = {Addressing_Value};
|
||||
o.type = default_type(type);
|
||||
bool can_convert = check_cast_internal(ctx, &o, specialization);
|
||||
return can_convert;
|
||||
} else if (t->kind == Type_Struct) {
|
||||
if (t->Struct.polymorphic_parent == specialization) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user