mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 06:42:39 +00:00
Fix parse support for 'fn F[];' (#5135)
According to approved syntax at https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3848.md#syntax-defined, `fn F[]` without explicit parameters should be valid. This makes it work, then adds some validation to prevent `class C[]` in check. Note that for `fn`, positional parameters are a TODO -- but this allows me to test validation in `fn destroy[]` which is rejected, not just a TODO.
This commit is contained in:
1 parent
a584ee120e
commit
8738497301
15 files changed
+402
-93
No files matched your search
@@ -62,6 +62,8 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
name, interface_decl_id, /*is_extern=*/false,
|
||||
SemIR::LibraryNameId::None)};
|
||||
|
||||
DiagnoseIfGenericMissingExplicitParameters(context, interface_info);
|
||||
|
||||
// Check whether this is a redeclaration.
|
||||
SemIR::ScopeLookupResult lookup_result =
|
||||
context.decl_name_stack().LookupOrAddName(
|
||||
|
||||
Reference in new issue
Block a user