Skip to content

Commit 80529aa

Browse files
zygoloidgeoffromer
andauthored
Convert the scrutinee of a binding pattern to the right category. (#5662)
When the binding pattern appears within a `var` pattern, convert to a reference. Otherwise, convert to a value. This gets the advent of code examples to produce the right answers again :) --------- Co-authored-by: Geoff Romer <[email protected]>
1 parent 1c09de9 commit 80529aa

29 files changed

+317
-260
lines changed

toolchain/check/convert.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,8 @@ static auto IsValidExprCategoryForConversionTarget(
696696
category == SemIR::ExprCategory::DurableRef ||
697697
category == SemIR::ExprCategory::EphemeralRef ||
698698
category == SemIR::ExprCategory::Initializing;
699+
case ConversionTarget::DurableRef:
700+
return category == SemIR::ExprCategory::DurableRef;
699701
case ConversionTarget::ExplicitAs:
700702
return true;
701703
case ConversionTarget::Initializer:
@@ -1340,12 +1342,19 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
13401342
// Commit to using a temporary for this initializing expression.
13411343
// TODO: Don't create a temporary if the initializing representation
13421344
// is already a value representation.
1345+
// TODO: If the target is DurableRef, materialize a VarStorage instead of
1346+
// a TemporaryStorage to lifetime-extend.
13431347
expr_id = FinalizeTemporary(context, expr_id,
13441348
target.kind == ConversionTarget::Discarded);
13451349
// We now have an ephemeral reference.
13461350
[[fallthrough]];
13471351

13481352
case SemIR::ExprCategory::DurableRef:
1353+
if (target.kind == ConversionTarget::DurableRef) {
1354+
break;
1355+
}
1356+
[[fallthrough]];
1357+
13491358
case SemIR::ExprCategory::EphemeralRef:
13501359
// If a reference expression is an acceptable result, we're done.
13511360
if (target.kind == ConversionTarget::ValueOrRef ||
@@ -1362,6 +1371,18 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
13621371
[[fallthrough]];
13631372

13641373
case SemIR::ExprCategory::Value:
1374+
if (target.kind == ConversionTarget::DurableRef) {
1375+
if (target.diagnose) {
1376+
CARBON_DIAGNOSTIC(ConversionFailureNonRefToRef, Error,
1377+
"cannot bind durable reference to non-reference "
1378+
"value of type {0}",
1379+
SemIR::TypeId);
1380+
context.emitter().Emit(loc_id, ConversionFailureNonRefToRef,
1381+
target.type_id);
1382+
}
1383+
return SemIR::ErrorInst::InstId;
1384+
}
1385+
13651386
// When initializing from a value, perform a copy.
13661387
if (target.is_initializer()) {
13671388
expr_id = PerformCopy(context, expr_id, target.diagnose);

toolchain/check/convert.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ struct ConversionTarget {
1919
Value,
2020
// Convert to either a value or a reference of type `type_id`.
2121
ValueOrRef,
22+
// Convert to a durable reference of type `type_id`.
23+
DurableRef,
2224
// Convert for an explicit `as` cast. This allows any expression category
2325
// as the result, and uses the `As` interface instead of the `ImplicitAs`
2426
// interface.

toolchain/check/pattern_match.cpp

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ class MatchContext {
4848
SemIR::InstId pattern_id;
4949
// `None` when processing the callee side.
5050
SemIR::InstId scrutinee_id;
51+
// Whether we are in a context where plain bindings are reference bindings.
52+
// This happens in var patterns.
53+
bool ref_binding_context;
5154

5255
auto Print(llvm::raw_ostream& out) const -> void {
5356
out << "{pattern_id: " << pattern_id << ", scrutinee_id: " << scrutinee_id
54-
<< "}";
57+
<< ", ref_binding_context: " << ref_binding_context << "}";
5558
}
5659
};
5760

@@ -224,10 +227,18 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
224227
InsertHere(context, type_expr_region_id);
225228
auto value_id = SemIR::InstId::None;
226229
if (kind_ == MatchKind::Local) {
230+
auto conversion_kind = entry.ref_binding_context
231+
? ConversionTarget::DurableRef
232+
: ConversionTarget::Value;
233+
if (!bind_name_id.has_value()) {
234+
// TODO: Is this appropriate, or should we perform a conversion based on
235+
// whether the `_` binding is a value or ref binding first, and then
236+
// separately discard the initializer for a `_` binding?
237+
conversion_kind = ConversionTarget::Discarded;
238+
}
227239
value_id =
228240
Convert(context, SemIR::LocId(entry.scrutinee_id), entry.scrutinee_id,
229-
{.kind = bind_name_id.has_value() ? ConversionTarget::ValueOrRef
230-
: ConversionTarget::Discarded,
241+
{.kind = conversion_kind,
231242
.type_id = context.insts().Get(bind_name_id).type_id()});
232243
} else {
233244
// In a function call, conversion is handled while matching the enclosing
@@ -253,7 +264,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
253264
// the caller side of the pattern, so we traverse without emitting any
254265
// insts.
255266
AddWork({.pattern_id = addr_pattern.inner_id,
256-
.scrutinee_id = SemIR::InstId::None});
267+
.scrutinee_id = SemIR::InstId::None,
268+
.ref_binding_context = false});
257269
return;
258270
}
259271
CARBON_CHECK(entry.scrutinee_id.has_value());
@@ -279,13 +291,16 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
279291
context, SemIR::LocId(scrutinee_ref_id),
280292
{.type_id = GetPointerType(context, scrutinee_ref_type_inst_id),
281293
.lvalue_id = scrutinee_ref_id});
282-
AddWork({.pattern_id = addr_pattern.inner_id, .scrutinee_id = new_scrutinee});
294+
AddWork({.pattern_id = addr_pattern.inner_id,
295+
.scrutinee_id = new_scrutinee,
296+
.ref_binding_context = false});
283297
}
284298

285299
auto MatchContext::DoEmitPatternMatch(Context& context,
286300
SemIR::ValueParamPattern param_pattern,
287301
SemIR::InstId pattern_inst_id,
288302
WorkItem entry) -> void {
303+
CARBON_CHECK(!entry.ref_binding_context);
289304
switch (kind_) {
290305
case MatchKind::Caller: {
291306
CARBON_CHECK(
@@ -320,7 +335,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
320335
.pretty_name_id = SemIR::GetPrettyNameFromPatternId(
321336
context.sem_ir(), entry.pattern_id)});
322337
AddWork({.pattern_id = param_pattern.subpattern_id,
323-
.scrutinee_id = param_id});
338+
.scrutinee_id = param_id,
339+
.ref_binding_context = entry.ref_binding_context});
324340
results_.push_back(param_id);
325341
break;
326342
}
@@ -334,6 +350,7 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
334350
SemIR::RefParamPattern param_pattern,
335351
SemIR::InstId pattern_inst_id,
336352
WorkItem entry) -> void {
353+
CARBON_CHECK(entry.ref_binding_context);
337354
switch (kind_) {
338355
case MatchKind::Caller: {
339356
CARBON_CHECK(
@@ -362,7 +379,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
362379
.pretty_name_id = SemIR::GetPrettyNameFromPatternId(
363380
context.sem_ir(), entry.pattern_id)});
364381
AddWork({.pattern_id = param_pattern.subpattern_id,
365-
.scrutinee_id = param_id});
382+
.scrutinee_id = param_id,
383+
.ref_binding_context = entry.ref_binding_context});
366384
results_.push_back(param_id);
367385
break;
368386
}
@@ -376,6 +394,7 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
376394
SemIR::OutParamPattern param_pattern,
377395
SemIR::InstId pattern_inst_id,
378396
WorkItem entry) -> void {
397+
CARBON_CHECK(!entry.ref_binding_context);
379398
switch (kind_) {
380399
case MatchKind::Caller: {
381400
CARBON_CHECK(
@@ -408,7 +427,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
408427
.pretty_name_id = SemIR::GetPrettyNameFromPatternId(
409428
context.sem_ir(), entry.pattern_id)});
410429
AddWork({.pattern_id = param_pattern.subpattern_id,
411-
.scrutinee_id = param_id});
430+
.scrutinee_id = param_id,
431+
.ref_binding_context = entry.ref_binding_context});
412432
results_.push_back(param_id);
413433
break;
414434
}
@@ -447,7 +467,8 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
447467
// the caller side of the pattern, so we traverse without emitting any
448468
// insts.
449469
AddWork({.pattern_id = var_pattern.subpattern_id,
450-
.scrutinee_id = SemIR::InstId::None});
470+
.scrutinee_id = SemIR::InstId::None,
471+
.ref_binding_context = true});
451472
return;
452473
}
453474
case MatchKind::Local: {
@@ -481,8 +502,9 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
481502
AddInst<SemIR::Assign>(context, SemIR::LocId(pattern_inst_id),
482503
{.lhs_id = storage_id, .rhs_id = init_id});
483504
}
484-
AddWork(
485-
{.pattern_id = var_pattern.subpattern_id, .scrutinee_id = storage_id});
505+
AddWork({.pattern_id = var_pattern.subpattern_id,
506+
.scrutinee_id = storage_id,
507+
.ref_binding_context = true});
486508
if (context.scope_stack().PeekIndex() == ScopeIndex::Package) {
487509
context.global_init().Suspend();
488510
}
@@ -500,8 +522,9 @@ auto MatchContext::DoEmitPatternMatch(Context& context,
500522
[&](llvm::ArrayRef<SemIR::InstId> subscrutinee_ids) {
501523
for (auto [subpattern_id, subscrutinee_id] :
502524
llvm::reverse(llvm::zip(subpattern_ids, subscrutinee_ids))) {
503-
AddWork(
504-
{.pattern_id = subpattern_id, .scrutinee_id = subscrutinee_id});
525+
AddWork({.pattern_id = subpattern_id,
526+
.scrutinee_id = subscrutinee_id,
527+
.ref_binding_context = entry.ref_binding_context});
505528
}
506529
};
507530
if (!entry.scrutinee_id.has_value()) {
@@ -627,22 +650,25 @@ auto CalleePatternMatch(Context& context,
627650
// in the original order.
628651
if (return_slot_pattern_id.has_value()) {
629652
match.AddWork({.pattern_id = return_slot_pattern_id,
630-
.scrutinee_id = SemIR::InstId::None});
653+
.scrutinee_id = SemIR::InstId::None,
654+
.ref_binding_context = false});
631655
}
632656

633657
if (param_patterns_id.has_value()) {
634658
for (SemIR::InstId inst_id :
635659
llvm::reverse(context.inst_blocks().Get(param_patterns_id))) {
636-
match.AddWork(
637-
{.pattern_id = inst_id, .scrutinee_id = SemIR::InstId::None});
660+
match.AddWork({.pattern_id = inst_id,
661+
.scrutinee_id = SemIR::InstId::None,
662+
.ref_binding_context = false});
638663
}
639664
}
640665

641666
if (implicit_param_patterns_id.has_value()) {
642667
for (SemIR::InstId inst_id :
643668
llvm::reverse(context.inst_blocks().Get(implicit_param_patterns_id))) {
644-
match.AddWork(
645-
{.pattern_id = inst_id, .scrutinee_id = SemIR::InstId::None});
669+
match.AddWork({.pattern_id = inst_id,
670+
.scrutinee_id = SemIR::InstId::None,
671+
.ref_binding_context = false});
646672
}
647673
}
648674

@@ -663,17 +689,22 @@ auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id,
663689
if (return_slot_arg_id.has_value()) {
664690
CARBON_CHECK(return_slot_pattern_id.has_value());
665691
match.AddWork({.pattern_id = return_slot_pattern_id,
666-
.scrutinee_id = return_slot_arg_id});
692+
.scrutinee_id = return_slot_arg_id,
693+
.ref_binding_context = false});
667694
}
668695

669696
// Check type conversions per-element.
670697
for (auto [arg_id, param_pattern_id] : llvm::reverse(llvm::zip_equal(
671698
arg_refs, context.inst_blocks().GetOrEmpty(param_patterns_id)))) {
672-
match.AddWork({.pattern_id = param_pattern_id, .scrutinee_id = arg_id});
699+
match.AddWork({.pattern_id = param_pattern_id,
700+
.scrutinee_id = arg_id,
701+
.ref_binding_context = false});
673702
}
674703

675704
if (self_pattern_id.has_value()) {
676-
match.AddWork({.pattern_id = self_pattern_id, .scrutinee_id = self_arg_id});
705+
match.AddWork({.pattern_id = self_pattern_id,
706+
.scrutinee_id = self_arg_id,
707+
.ref_binding_context = false});
677708
}
678709

679710
return match.DoWork(context);
@@ -682,7 +713,9 @@ auto CallerPatternMatch(Context& context, SemIR::SpecificId specific_id,
682713
auto LocalPatternMatch(Context& context, SemIR::InstId pattern_id,
683714
SemIR::InstId scrutinee_id) -> void {
684715
MatchContext match(MatchKind::Local);
685-
match.AddWork({.pattern_id = pattern_id, .scrutinee_id = scrutinee_id});
716+
match.AddWork({.pattern_id = pattern_id,
717+
.scrutinee_id = scrutinee_id,
718+
.ref_binding_context = false});
686719
match.DoWork(context);
687720
}
688721

toolchain/check/testdata/alias/basics.carbon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ extern alias C = Class;
187187
// CHECK:STDOUT: %.loc10_13.2: init %C = class_init (), %.loc10_13.1 [concrete = constants.%C.val]
188188
// CHECK:STDOUT: %.loc10_13.3: ref %C = temporary %.loc10_13.1, %.loc10_13.2
189189
// CHECK:STDOUT: %.loc10_13.4: ref %C = converted @__global_init.%.loc10, %.loc10_13.3
190-
// CHECK:STDOUT: %d: ref %C = bind_name d, %.loc10_13.4
190+
// CHECK:STDOUT: %.loc10_13.5: %C = bind_value %.loc10_13.4
191+
// CHECK:STDOUT: %d: %C = bind_name d, %.loc10_13.5
191192
// CHECK:STDOUT: }
192193
// CHECK:STDOUT:
193194
// CHECK:STDOUT: fn @__global_init() {

toolchain/check/testdata/as/adapter_conversion.carbon

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ var b: B = {.x = ()} as B;
182182
// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
183183
// CHECK:STDOUT: %B: type = class_type @B [concrete]
184184
// CHECK:STDOUT: %pattern_type.049: type = pattern_type %B [concrete]
185-
// CHECK:STDOUT: %a_ref.var: ref %B = var file.%a_ref.var_patt [concrete]
186185
// CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete]
187186
// CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete]
187+
// CHECK:STDOUT: %a_ref.var: ref %B = var file.%a_ref.var_patt [concrete]
188188
// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %a_ref.var [concrete]
189189
// CHECK:STDOUT: }
190190
// CHECK:STDOUT:
@@ -196,7 +196,7 @@ var b: B = {.x = ()} as B;
196196
// CHECK:STDOUT: %b_val.patt: %pattern_type.049 = binding_pattern b_val [concrete]
197197
// CHECK:STDOUT: }
198198
// CHECK:STDOUT: %B.ref.loc22: type = name_ref B, %B.decl [concrete = constants.%B]
199-
// CHECK:STDOUT: %b_val: ref %B = bind_name b_val, @__global_init.%.loc22_22.2 [concrete = constants.%a_ref.var]
199+
// CHECK:STDOUT: %b_val: %B = bind_name b_val, @__global_init.%.loc22_22.2
200200
// CHECK:STDOUT: name_binding_decl {
201201
// CHECK:STDOUT: %b_ptr.patt: %pattern_type.960 = binding_pattern b_ptr [concrete]
202202
// CHECK:STDOUT: }
@@ -217,10 +217,10 @@ var b: B = {.x = ()} as B;
217217
// CHECK:STDOUT: fn @__global_init() {
218218
// CHECK:STDOUT: !entry:
219219
// CHECK:STDOUT: <elided>
220-
// CHECK:STDOUT: %a_val.ref: ref %A = name_ref a_val, file.%a_val [concrete = file.%a_ref.var]
220+
// CHECK:STDOUT: %a_val.ref: %A = name_ref a_val, file.%a_val
221221
// CHECK:STDOUT: %B.ref.loc22: type = name_ref B, file.%B.decl [concrete = constants.%B]
222-
// CHECK:STDOUT: %.loc22_22.1: ref %B = as_compatible %a_val.ref [concrete = constants.%a_ref.var]
223-
// CHECK:STDOUT: %.loc22_22.2: ref %B = converted %a_val.ref, %.loc22_22.1 [concrete = constants.%a_ref.var]
222+
// CHECK:STDOUT: %.loc22_22.1: %B = as_compatible %a_val.ref
223+
// CHECK:STDOUT: %.loc22_22.2: %B = converted %a_val.ref, %.loc22_22.1
224224
// CHECK:STDOUT: %a_ref.ref.loc23: ref %A = name_ref a_ref, file.%a_ref [concrete = file.%a_ref.var]
225225
// CHECK:STDOUT: %B.ref.loc23: type = name_ref B, file.%B.decl [concrete = constants.%B]
226226
// CHECK:STDOUT: %.loc23_25.1: ref %B = as_compatible %a_ref.ref.loc23 [concrete = constants.%a_ref.var]
@@ -379,7 +379,8 @@ var b: B = {.x = ()} as B;
379379
// CHECK:STDOUT: %b_value.patt: %pattern_type.049 = binding_pattern b_value [concrete]
380380
// CHECK:STDOUT: }
381381
// CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [concrete = constants.%B]
382-
// CHECK:STDOUT: %b_value: ref %B = bind_name b_value, @__global_init.%.loc14_42.2
382+
// CHECK:STDOUT: %.loc14: %B = bind_value @__global_init.%.loc14_42.2
383+
// CHECK:STDOUT: %b_value: %B = bind_name b_value, %.loc14
383384
// CHECK:STDOUT: }
384385
// CHECK:STDOUT:
385386
// CHECK:STDOUT: fn @__global_init() {

toolchain/check/testdata/as/basics.carbon

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,9 @@ let n: {.x: ()} = {.x = ()} as {.x = ()};
362362
// CHECK:STDOUT: %n.patt: %pattern_type.c27 = binding_pattern n [concrete]
363363
// CHECK:STDOUT: }
364364
// CHECK:STDOUT: %Y.ref: type = name_ref Y, %Y.decl [concrete = constants.%Y]
365-
// CHECK:STDOUT: %.loc19: ref %Y = temporary @__global_init.%.loc19_29.1, @__global_init.%.loc19_29.2
366-
// CHECK:STDOUT: %n: ref %Y = bind_name n, %.loc19
365+
// CHECK:STDOUT: %.loc19_29.1: ref %Y = temporary @__global_init.%.loc19_29.1, @__global_init.%.loc19_29.2
366+
// CHECK:STDOUT: %.loc19_29.2: %Y = bind_value %.loc19_29.1
367+
// CHECK:STDOUT: %n: %Y = bind_name n, %.loc19_29.2
367368
// CHECK:STDOUT: }
368369
// CHECK:STDOUT:
369370
// CHECK:STDOUT: fn @__global_init() {

toolchain/check/testdata/builtins/int/convert_checked.carbon

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -315,29 +315,29 @@ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant);
315315
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
316316
// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32]
317317
// CHECK:STDOUT: }
318-
// CHECK:STDOUT: %.loc6_42.1: ref %u32 = temporary_storage
319-
// CHECK:STDOUT: %.loc6_42.2: ref %u32 = temporary %.loc6_42.1, @__global_init.%int.convert_checked.loc6_42
320-
// CHECK:STDOUT: %SizePreserving: ref %u32 = bind_name SizePreserving, %.loc6_42.2
318+
// CHECK:STDOUT: %.loc6_42.1: %u32 = value_of_initializer @__global_init.%int.convert_checked.loc6_42 [concrete = constants.%int_1.c1d]
319+
// CHECK:STDOUT: %.loc6_42.2: %u32 = converted @__global_init.%int.convert_checked.loc6_42, %.loc6_42.1 [concrete = constants.%int_1.c1d]
320+
// CHECK:STDOUT: %SizePreserving: %u32 = bind_name SizePreserving, %.loc6_42.2
321321
// CHECK:STDOUT: name_binding_decl {
322322
// CHECK:STDOUT: %Narrowing.patt: %pattern_type.88f = binding_pattern Narrowing [concrete]
323323
// CHECK:STDOUT: }
324324
// CHECK:STDOUT: %.loc7_16: type = splice_block %i16 [concrete = constants.%i16] {
325325
// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
326326
// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
327327
// CHECK:STDOUT: }
328-
// CHECK:STDOUT: %.loc7_36.1: ref %i16 = temporary_storage
329-
// CHECK:STDOUT: %.loc7_36.2: ref %i16 = temporary %.loc7_36.1, @__global_init.%int.convert_checked.loc7_36
330-
// CHECK:STDOUT: %Narrowing: ref %i16 = bind_name Narrowing, %.loc7_36.2
328+
// CHECK:STDOUT: %.loc7_36.1: %i16 = value_of_initializer @__global_init.%int.convert_checked.loc7_36 [concrete = constants.%int_1.c22]
329+
// CHECK:STDOUT: %.loc7_36.2: %i16 = converted @__global_init.%int.convert_checked.loc7_36, %.loc7_36.1 [concrete = constants.%int_1.c22]
330+
// CHECK:STDOUT: %Narrowing: %i16 = bind_name Narrowing, %.loc7_36.2
331331
// CHECK:STDOUT: name_binding_decl {
332332
// CHECK:STDOUT: %Widening.patt: %pattern_type.a10 = binding_pattern Widening [concrete]
333333
// CHECK:STDOUT: }
334334
// CHECK:STDOUT: %.loc8_15: type = splice_block %i64 [concrete = constants.%i64] {
335335
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
336336
// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
337337
// CHECK:STDOUT: }
338-
// CHECK:STDOUT: %.loc8_35.1: ref %i64 = temporary_storage
339-
// CHECK:STDOUT: %.loc8_35.2: ref %i64 = temporary %.loc8_35.1, @__global_init.%int.convert_checked.loc8_35
340-
// CHECK:STDOUT: %Widening: ref %i64 = bind_name Widening, %.loc8_35.2
338+
// CHECK:STDOUT: %.loc8_35.1: %i64 = value_of_initializer @__global_init.%int.convert_checked.loc8_35 [concrete = constants.%int_1.a95]
339+
// CHECK:STDOUT: %.loc8_35.2: %i64 = converted @__global_init.%int.convert_checked.loc8_35, %.loc8_35.1 [concrete = constants.%int_1.a95]
340+
// CHECK:STDOUT: %Widening: %i64 = bind_name Widening, %.loc8_35.2
341341
// CHECK:STDOUT: }
342342
// CHECK:STDOUT:
343343
// CHECK:STDOUT: fn @__global_init() {

0 commit comments

Comments
 (0)