mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Separate pattern types from expression types (#5360)
This is a step toward treating patterns as compile-time constants, so that we can import them more easily.
This commit is contained in:
+6
-4
@@ -23,6 +23,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.5d8: type = pattern_type %array_type [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
@@ -48,6 +49,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete]
|
||||
// CHECK:STDOUT: %tuple.type.189: type = tuple_type (%i32, %i32, %i32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.b5a: type = pattern_type %tuple.type.189 [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.189 = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -72,8 +74,8 @@ fn G() {
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %array_type = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc13_3.1: %array_type = var_pattern %a.patt
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.5d8 = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc13_3.1: %pattern_type.5d8 = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %array_type = var a
|
||||
// CHECK:STDOUT: %int_1.loc13_27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
@@ -118,8 +120,8 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %array_type = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %tuple.type.189 = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc14_3.1: %tuple.type.189 = var_pattern %b.patt
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.b5a = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc14_3.1: %pattern_type.b5a = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %tuple.type.189 = var b
|
||||
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
|
||||
Reference in New Issue
Block a user