mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 06:54:44 +01: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:
@@ -233,6 +233,8 @@ static auto BuildClassDecl(Context& context, Parse::AnyClassDeclId node_id,
|
||||
.self_type_id = SemIR::TypeId::None,
|
||||
.inheritance_kind = inheritance_kind}};
|
||||
|
||||
DiagnoseIfGenericMissingExplicitParameters(context, class_info);
|
||||
|
||||
MergeOrAddName(context, node_id, name_context, class_decl_id, class_decl,
|
||||
class_info, is_definition,
|
||||
introducer.modifier_set.GetAccessKind());
|
||||
|
||||
Reference in New Issue
Block a user