mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix test, fix type name.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user