mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Convert array bounds to IntLiteral. (#4526)
Instead of leaving array bounds as whatever integer type they arrive as, convert them to the `IntLiteral` type as part of forming an `ArrayType`. This ensures that array types canonicalize properly even when the bounds are specified with different types. Create an empty generic definition for a generic builtin function to avoid this causing "use of undefined generic function" errors.
This commit is contained in:
@@ -502,6 +502,9 @@ auto HandleParseNode(Context& context,
|
||||
auto& function = context.functions().Get(function_id);
|
||||
if (IsValidBuiltinDeclaration(context, function, builtin_kind)) {
|
||||
function.builtin_function_kind = builtin_kind;
|
||||
// Build an empty generic definition if this is a generic builtin.
|
||||
StartGenericDefinition(context);
|
||||
FinishGenericDefinition(context, function.generic_id);
|
||||
} else {
|
||||
CARBON_DIAGNOSTIC(InvalidBuiltinSignature, Error,
|
||||
"invalid signature for builtin function \"{0}\"",
|
||||
|
||||
Reference in New Issue
Block a user