Skip to content

Commit

Permalink
Expose indexing as a language interface (#4370)
Browse files Browse the repository at this point in the history
This PR makes it so that types can implement the `IndexWith` interface
so that they can provide their custom indexing behavior.

---------

Co-authored-by: Jon Ross-Perkins <[email protected]>
  • Loading branch information
brymer-meneses and jonmeow authored Oct 29, 2024
1 parent c30b1d1 commit 89eed42
Show file tree
Hide file tree
Showing 464 changed files with 2,506 additions and 29 deletions.
1 change: 1 addition & 0 deletions core/prelude/operators.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ package Core library "prelude/operators";

export import library "prelude/operators/arithmetic";
export import library "prelude/operators/as";
export import library "prelude/operators/index";
export import library "prelude/operators/bitwise";
export import library "prelude/operators/comparison";
9 changes: 9 additions & 0 deletions core/prelude/operators/index.carbon
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 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

package Core library "prelude/operators/index";

interface IndexWith(SubscriptType:! type, ElementType:! type) {
fn At[self: Self](subscript: SubscriptType) -> ElementType;
}
1 change: 1 addition & 0 deletions toolchain/check/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ cc_library(
"//toolchain/parse:node_kind",
"//toolchain/parse:tree",
"//toolchain/parse:tree_node_diagnostic_converter",
"//toolchain/sem_ir:builtin_inst_kind",
"//toolchain/sem_ir:entry_point",
"//toolchain/sem_ir:file",
"//toolchain/sem_ir:ids",
Expand Down
115 changes: 109 additions & 6 deletions toolchain/check/handle_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <optional>

#include "toolchain/base/kind_switch.h"
#include "toolchain/check/context.h"
#include "toolchain/check/convert.h"
#include "toolchain/check/handle.h"
#include "toolchain/check/operator.h"
#include "toolchain/diagnostics/diagnostic.h"
#include "toolchain/sem_ir/builtin_inst_kind.h"
#include "toolchain/sem_ir/inst.h"
#include "toolchain/sem_ir/typed_insts.h"

namespace Carbon::Check {

Expand All @@ -16,17 +22,113 @@ auto HandleParseNode(Context& /*context*/, Parse::IndexExprStartId /*node_id*/)
return true;
}

// Returns the argument values of the `IndexWith` interface. Arguments
// correspond to the `SubscriptType` and the `ElementType`. If no arguments are
// used to define `IndexWith`, this returns an empty array reference. If the
// class does not implement the said interface, this returns a `std::nullopt`.
// TODO: Switch to using an associated type instead of a parameter for the
// `ElementType`.
static auto GetIndexWithArgs(Context& context, Parse::NodeId node_id,
SemIR::TypeId self_id)
-> std::optional<llvm::ArrayRef<SemIR::InstId>> {
auto index_with_inst_id = context.LookupNameInCore(node_id, "IndexWith");
// If the `IndexWith` interface doesn't have generic arguments then return an
// empty reference.
if (context.insts().Is<SemIR::InterfaceType>(index_with_inst_id)) {
return llvm::ArrayRef<SemIR::InstId>();
}

auto index_with_inst =
context.insts().TryGetAsIfValid<SemIR::StructValue>(index_with_inst_id);
if (!index_with_inst) {
return std::nullopt;
}

auto index_with_interface =
context.types().TryGetAs<SemIR::GenericInterfaceType>(
index_with_inst->type_id);
if (!index_with_interface) {
return std::nullopt;
}

for (const auto& impl : context.impls().array_ref()) {
auto impl_self_type_id = context.GetTypeIdForTypeInst(impl.self_id);
auto impl_constraint_type_id =
context.GetTypeIdForTypeInst(impl.constraint_id);

if (impl_self_type_id != self_id) {
continue;
}
auto interface_type =
context.types().TryGetAs<SemIR::InterfaceType>(impl_constraint_type_id);
if (!interface_type) {
continue;
}

if (index_with_interface->interface_id != interface_type->interface_id) {
continue;
}

return context.inst_blocks().GetOrEmpty(
context.specifics().Get(interface_type->specific_id).args_id);
}

return std::nullopt;
}

// Performs an index with base expression `operand_inst_id` and
// `operand_type_id` for types that are not an array. This checks if
// the base expression implements the `IndexWith` interface; if so, uses the
// `At` associative method, otherwise prints a diagnostic.
static auto PerformIndexWith(Context& context, Parse::NodeId node_id,
SemIR::InstId operand_inst_id,
SemIR::TypeId operand_type_id,
SemIR::InstId index_inst_id) -> SemIR::InstId {
auto args = GetIndexWithArgs(context, node_id, operand_type_id);

// If the type does not implement the `IndexWith` interface, then return
// an error.
if (!args) {
CARBON_DIAGNOSTIC(TypeNotIndexable, Error,
"type {0} does not support indexing", SemIR::TypeId);
context.emitter().Emit(node_id, TypeNotIndexable, operand_type_id);
return SemIR::InstId::BuiltinError;
}

Operator op{
.interface_name = "IndexWith",
.interface_args_ref = *args,
.op_name = "At",
};

// IndexWith is defined without generic arguments.
if (args->empty()) {
return BuildBinaryOperator(context, node_id, op, operand_inst_id,
index_inst_id);
}

// The first argument of the `IndexWith` interface corresponds to the
// `SubscriptType`, so first cast `index_inst_id` to that type.
auto subscript_type_id = context.GetTypeIdForTypeInst((*args)[0]);
auto cast_index_id =
ConvertToValueOfType(context, node_id, index_inst_id, subscript_type_id);

return BuildBinaryOperator(context, node_id, op, operand_inst_id,
cast_index_id);
}

auto HandleParseNode(Context& context, Parse::IndexExprId node_id) -> bool {
auto index_inst_id = context.node_stack().PopExpr();
auto operand_inst_id = context.node_stack().PopExpr();
operand_inst_id = ConvertToValueOrRefExpr(context, operand_inst_id);
auto operand_inst = context.insts().Get(operand_inst_id);
auto operand_type_id = operand_inst.type_id();

CARBON_KIND_SWITCH(context.types().GetAsInst(operand_type_id)) {
case CARBON_KIND(SemIR::ArrayType array_type): {
auto index_node_id = context.insts().GetLocId(index_inst_id);
auto index_loc_id = context.insts().GetLocId(index_inst_id);
auto cast_index_id = ConvertToValueOfType(
context, index_node_id, index_inst_id,
context, index_loc_id, index_inst_id,
context.GetBuiltinType(SemIR::BuiltinInstKind::IntType));
auto array_cat =
SemIR::GetExprCategory(context.sem_ir(), operand_inst_id);
Expand All @@ -52,13 +154,14 @@ auto HandleParseNode(Context& context, Parse::IndexExprId node_id) -> bool {
context.node_stack().Push(node_id, elem_id);
return true;
}

default: {
auto elem_id = SemIR::InstId::BuiltinError;
if (operand_type_id != SemIR::TypeId::Error) {
CARBON_DIAGNOSTIC(TypeNotIndexable, Error,
"type {0} does not support indexing", TypeOfInstId);
context.emitter().Emit(node_id, TypeNotIndexable, operand_inst_id);
elem_id = PerformIndexWith(context, node_id, operand_inst_id,
operand_type_id, index_inst_id);
}
context.node_stack().Push(node_id, SemIR::InstId::BuiltinError);
context.node_stack().Push(node_id, elem_id);
return true;
}
}
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/alias/fail_bool_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ let a_test: bool = a;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/alias/fail_builtins.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ alias b = bool;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/alias/fail_control_flow.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ alias a = true or false;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/array_in_place.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ fn G() {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/array_vs_tuple.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ fn G() {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/assign_return_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn Run() {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/assign_var.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var b: [i32; 3] = a;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/base.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var c: [(); 5] = ((), (), (), (), (),);
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/canonicalize_index.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ let b: [i32; 3]* = &a;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/fail_bound_negative.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var a: [i32; Negate(1)];
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/fail_bound_overflow.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var b: [1; 39999999999999999993];
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var p: Incomplete* = &a[0];
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/fail_invalid_type.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var a: [1; 1];
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/fail_out_of_bound.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var a: [i32; 1] = (1, 2, 3);
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var b: i32 = a[{.index = 3}.index];
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/fail_type_mismatch.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ var d: [i32; 3] = t2;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/function_param.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn G() -> i32 {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/generic_empty.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fn G(T:! type) {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/index_not_literal.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var b: i32 = a[{.index = 2}.index];
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/array/nine_elements.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9);
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
5 changes: 5 additions & 0 deletions toolchain/check/testdata/as/adapter_conversion.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ var b: B = {.x = 1} as B;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down Expand Up @@ -274,6 +275,7 @@ var b: B = {.x = 1} as B;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down Expand Up @@ -349,6 +351,7 @@ var b: B = {.x = 1} as B;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down Expand Up @@ -443,6 +446,7 @@ var b: B = {.x = 1} as B;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down Expand Up @@ -577,6 +581,7 @@ var b: B = {.x = 1} as B;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/as/as_type.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ let t: type = (i32, i32) as type;
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
1 change: 1 addition & 0 deletions toolchain/check/testdata/as/basic.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn Main() -> i32 {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool
Expand Down
Loading

0 comments on commit 89eed42

Please sign in to comment.