fix typo#1492 (#1493)

* fix typo#1492 
* Fix missing update in sema_decls

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Rachad ADEKAMBI
2024-09-27 23:22:15 +01:00
committed by GitHub
parent b071e24d7e
commit 2146a76795
2 changed files with 2 additions and 2 deletions

2
src/compiler/sema_decls.c Normal file → Executable file
View File

@@ -1837,7 +1837,7 @@ INLINE bool sema_analyse_operator_method(SemaContext *context, Type *parent_type
if (!type_is_user_defined(parent_type))
{
sema_error_at(context, method_find_overload_span(method),
"Only user-defined types support operator oveloading.");
"Only user-defined types support operator overloading.");
return false;
}

2
test/test_suite/methods/unsupported_operator.c3 Normal file → Executable file
View File

@@ -1,3 +1,3 @@
import std::io;
fn int int.fadd(&self, int x) @operator([]) { return 1; } // #error: Only user-defined types support operator oveloading
fn int int.fadd(&self, int x) @operator([]) { return 1; } // #error: Only user-defined types support operator overloading