Skip to content

Commit 89308d1

Browse files
committed
refactor(sema): diagnose limitations of metafunction lookup
1 parent 5b9fedc commit 89308d1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

source/sema.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ auto lookup_metafunction(
3232
)
3333
-> meta::expected<meta::lookup_res>
3434
{
35-
auto res = meta::lookup_res{};
36-
3735
struct scope_t {
3836
std::string fully_qualified_mangled_name;
3937
current_names_span::pointer names_first;
@@ -101,12 +99,12 @@ auto lookup_metafunction(
10199
}
102100
}
103101

104-
// Case not yet handled.
105-
if (res.library.empty()) {
106-
return meta::diagnostic{"(ICE) metafunction '" + name + "' not found"};
107-
}
108-
// else
109-
return res;
102+
return meta::diagnostic{
103+
"metafunction '" + name + "' not found\n"
104+
+ "(temporary alpha limitation) lookup for a metafunction name is limited: "
105+
+ "it can be used unqualified from its declaring namespace or a nested namespace thereof, "
106+
+ "and otherwise requires full qualification"
107+
};
110108
}
111109

112110
auto parser::apply_type_metafunctions( declaration_node& n )

0 commit comments

Comments
 (0)