Fix test, fix type name.

This commit is contained in:
Christoffer Lerno
2025-04-04 13:48:07 +02:00
parent 65fb977e89
commit ded5fde2d5
2 changed files with 3 additions and 3 deletions

View File

@@ -780,7 +780,7 @@ static Type *type_generate_optional(Type *optional_type, bool canonical)
Type *optional = optional_type->type_cache[OPTIONAL_OFFSET];
if (optional == NULL)
{
optional = type_new(TYPE_OPTIONAL, str_printf("%s!", optional_type->name));
optional = type_new(TYPE_OPTIONAL, str_printf("%s?", optional_type->name));
optional->pointer = optional_type;
optional_type->type_cache[OPTIONAL_OFFSET] = optional;
if (optional_type == optional_type->canonical)

View File

@@ -1,9 +1,9 @@
fn String str(int& element) // #error: A ref parameter should always be untyped
fn String str(int& element) // #error: Ref parameters are only allowed on methods
{
return "abc";
}
fn String int.str(int& element) // #error: Ref parameters are only allowed on methods
fn String int.str(int& element) // #error: A ref parameter should always be untyped
{
return "abc";
}