Better handling of attribute definition errors. Resolves #753

This commit is contained in:
Christoffer Lerno
2023-05-26 11:31:02 +02:00
committed by Christoffer Lerno
parent b794c893d6
commit 07b107ff5e
3 changed files with 10 additions and 7 deletions

View File

@@ -1839,12 +1839,8 @@ static bool sema_analyse_attributes_inner(SemaContext *context, Decl *decl, Attr
// Custom attributes.
// First find it.
Decl *attr_decl = sema_find_symbol(context, attr->name);
if (!attr_decl || attr_decl->decl_kind != DECL_ATTRIBUTE)
{
SEMA_ERROR(attr, "The attribute '%s' could not be found.", attr->name);
return false;
}
Decl *attr_decl = sema_resolve_symbol(context, attr->name, attr->path, attr->span);
if (!attr_decl) return false;
// Detect direct cycles @Foo = @Bar @Bar = @Foo
if (attr_decl == top)

View File

@@ -1 +1 @@
#define COMPILER_VERSION "0.4.514"
#define COMPILER_VERSION "0.4.515"

View File

@@ -0,0 +1,7 @@
module abc;
define @Foo = { @inline };
module bar;
fn void test() abc::@Foo {} // #error: Did you mean the attribute