mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 12:31:04 +01:00
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 <gromer@google.com>
This commit is contained in:
co-authored by
Geoff Romer
parent
1c09de9b87
commit
80529aaef9
@@ -135,9 +135,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
|
||||
// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc7_30.1: ref %i16 = temporary_storage
|
||||
// CHECK:STDOUT: %.loc7_30.2: ref %i16 = temporary %.loc7_30.1, %foo_short.call
|
||||
// CHECK:STDOUT: %x: ref %i16 = bind_name x, %.loc7_30.2
|
||||
// CHECK:STDOUT: %.loc7_30.1: %i16 = value_of_initializer %foo_short.call
|
||||
// CHECK:STDOUT: %.loc7_30.2: %i16 = converted %foo_short.call, %.loc7_30.1
|
||||
// CHECK:STDOUT: %x: %i16 = bind_name x, %.loc7_30.2
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user