diff --git a/releasenotes.md b/releasenotes.md index aca6c944a..8ebad1194 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -45,6 +45,7 @@ - Use correct allocator in `replace`. - Regression: 1 character module names would create an error. - Compiler segfault with struct containing list of structs with an inline member #2416 +- Occasionally when using macro method extensions on built-in types, the liveness checker would try to process them. #2398 ### Stdlib changes - Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`. diff --git a/src/compiler/sema_decls.c b/src/compiler/sema_decls.c index 68ac66066..e17efd3f6 100755 --- a/src/compiler/sema_decls.c +++ b/src/compiler/sema_decls.c @@ -2319,7 +2319,7 @@ INLINE bool sema_analyse_operator_method(SemaContext *context, Type *parent_type { RETURN_SEMA_ERROR(method, "Only user-defined types may have overloads."); } - + Decl *other = NULL; if (operator >= OVERLOAD_TYPED_START) { @@ -2737,6 +2737,7 @@ static inline bool sema_compare_method_with_interface(SemaContext *context, Decl */ static inline bool sema_analyse_method(SemaContext *context, Decl *decl) { + ASSERT_SPAN(decl, decl->decl_kind == DECL_FUNC); // Check for @init, @finalizer, @test and @benchmark if (decl->func_decl.attr_init | decl->func_decl.attr_finalizer) {