mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Error on non-constant parameters to a type. (#4215)
At present, this is a crash bug. I don't know whether this is the best fix, but I figure it'll work until zygoloid has a chance to look.
This commit is contained in:
@@ -53,6 +53,11 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
auto interface_decl_id =
|
||||
context.AddPlaceholderInst(SemIR::LocIdAndInst(node_id, interface_decl));
|
||||
|
||||
SemIR::Interface interface_info = {name_context.MakeEntityWithParamsBase(
|
||||
name, interface_decl_id, /*is_extern=*/false)};
|
||||
RequireGenericParams(context, interface_info.implicit_param_refs_id);
|
||||
RequireGenericParams(context, interface_info.param_refs_id);
|
||||
|
||||
// Check whether this is a redeclaration.
|
||||
auto existing_id = context.decl_name_stack().LookupOrAddName(
|
||||
name_context, interface_decl_id, introducer.modifier_set.GetAccessKind());
|
||||
@@ -103,8 +108,6 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
// there was an error in the qualifier, we will have lost track of the
|
||||
// interface name here. We should keep track of it even if the name is
|
||||
// invalid.
|
||||
SemIR::Interface interface_info = {name_context.MakeEntityWithParamsBase(
|
||||
name, interface_decl_id, /*is_extern=*/false)};
|
||||
interface_info.generic_id = FinishGenericDecl(context, interface_decl_id);
|
||||
interface_decl.interface_id = context.interfaces().Add(interface_info);
|
||||
if (interface_info.has_parameters()) {
|
||||
|
||||
Reference in New Issue
Block a user