mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-26 21:31:19 +00:00
In line with the proposal in #4682, this changes the array syntax to be array(T, N). `array` is a builtin keyword which must be followed by parens containing two expressions and a separating comma. The array type expression is still fully builtin, it does not forward to a Core.Array library type yet. It merely adds the `ArrayType` instruction, as was done with the previous syntax. Followup work will change the instruction to reference to Core.Array, once the library type exists and can be used directly. --------- Co-authored-by: zygoloid <richard@metafoo.co.uk>
23 lines
764 B
Plaintext
23 lines
764 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// EXTRA-ARGS: --no-dump-sem-ir
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/or.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/int/or.carbon
|
|
|
|
// --- int_or.carbon
|
|
|
|
fn Or(a: i32, b: i32) -> i32 = "int.or";
|
|
|
|
var arr: array(i32, Or(12, 10));
|
|
let arr_p: array(i32, 14)* = &arr;
|
|
|
|
fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
|
|
return Or(a, b);
|
|
}
|