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:
Richard Smith
2024-11-15 22:09:31 +00:00
committed by GitHub
parent a65cde6ae2
commit 980ce6b25a
62 changed files with 2869 additions and 1432 deletions
+3
View File
@@ -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}\"",