|
|
@@ -34,14 +34,18 @@ let x: ElementType = c[s];
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-impl (i32, i32) as Core.IndexWith(Core.IntLiteral()) where .ElementType = i32 {
|
|
|
- fn At[self: Self](subscript: Core.IntLiteral()) -> i32 {
|
|
|
+class C {
|
|
|
+ adapt ();
|
|
|
+}
|
|
|
+
|
|
|
+impl (C, C) as Core.IndexWith(Core.IntLiteral()) where .ElementType = C {
|
|
|
+ fn At[self: Self](subscript: Core.IntLiteral()) -> C {
|
|
|
return self.0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-let s: (i32, i32) = (1, 5);
|
|
|
-let e: i32 = s[0];
|
|
|
+let s: (C, C) = (() as C, () as C);
|
|
|
+let e: C = s[0];
|
|
|
|
|
|
// --- fail_invalid_subscript_type.carbon
|
|
|
|
|
|
@@ -267,15 +271,13 @@ let x: i32 = c[0];
|
|
|
// CHECK:STDOUT: --- overloaded_builtin.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
-// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
|
-// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
|
|
-// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
|
|
-// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
|
|
|
-// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
|
+// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.af4: %empty_tuple.type = tuple_value () [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_tuple.type [concrete]
|
|
|
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
|
|
|
-// CHECK:STDOUT: %tuple.95a: %tuple.type.24b = tuple_value (%i32, %i32) [concrete]
|
|
|
-// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
|
|
|
+// CHECK:STDOUT: %tuple.0d6: %tuple.type.24b = tuple_value (%C, %C) [concrete]
|
|
|
+// CHECK:STDOUT: %tuple.type.56b: type = tuple_type (%C, %C) [concrete]
|
|
|
// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete]
|
|
|
// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %SubscriptType: type = symbolic_binding SubscriptType, 0 [symbolic]
|
|
|
@@ -291,210 +293,172 @@ let x: i32 = c[0];
|
|
|
// CHECK:STDOUT: %.Self.binding.as_type: type = symbolic_binding_type .Self, %.Self [symbolic_self]
|
|
|
// CHECK:STDOUT: %IndexWith.lookup_impl_witness.e03: <witness> = lookup_impl_witness %.Self, @IndexWith, @IndexWith(Core.IntLiteral) [symbolic_self]
|
|
|
// CHECK:STDOUT: %impl.elem0.f03: type = impl_witness_access %IndexWith.lookup_impl_witness.e03, element0 [symbolic_self]
|
|
|
-// CHECK:STDOUT: %IndexWith_where.type: type = facet_type <@IndexWith, @IndexWith(Core.IntLiteral) where %impl.elem0.f03 = %i32> [concrete]
|
|
|
+// CHECK:STDOUT: %IndexWith_where.type: type = facet_type <@IndexWith, @IndexWith(Core.IntLiteral) where %impl.elem0.f03 = %C> [concrete]
|
|
|
// CHECK:STDOUT: %IndexWith.impl_witness: <witness> = impl_witness file.%IndexWith.impl_witness_table [concrete]
|
|
|
-// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete]
|
|
|
-// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.99e: type = pattern_type %tuple.type.56b [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
|
|
|
// CHECK:STDOUT: %tuple.type.as.IndexWith.impl.At.type: type = fn_type @tuple.type.as.IndexWith.impl.At [concrete]
|
|
|
// CHECK:STDOUT: %tuple.type.as.IndexWith.impl.At: %tuple.type.as.IndexWith.impl.At.type = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.8ab = facet_value %tuple.type.d07, (%IndexWith.impl_witness) [concrete]
|
|
|
+// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.8ab = facet_value %tuple.type.56b, (%IndexWith.impl_witness) [concrete]
|
|
|
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
|
|
-// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
|
|
-// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
|
|
|
-// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.413: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
|
|
|
-// CHECK:STDOUT: %Int.as.Copy.impl.Op.2d6: %Int.as.Copy.impl.Op.type.413 = struct_value () [symbolic]
|
|
|
-// CHECK:STDOUT: %Copy.impl_witness.09c: <witness> = impl_witness imports.%Copy.impl_witness_table.e1c, @Int.as.Copy.impl(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.60b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %Int.as.Copy.impl.Op.c85: %Int.as.Copy.impl.Op.type.60b = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.09c) [concrete]
|
|
|
-// CHECK:STDOUT: %.fe5: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
|
|
|
-// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.c85, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
|
|
-// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
|
|
|
-// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
|
|
|
-// CHECK:STDOUT: %tuple.f6b: %tuple.type.f94 = tuple_value (%int_1.5b8, %int_5.64b) [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
|
|
|
-// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
|
|
|
-// CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.3d4: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %bound_method.d3a: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
|
|
-// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b1d: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
|
|
|
-// CHECK:STDOUT: %bound_method.06d: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
|
|
-// CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
|
|
|
-// CHECK:STDOUT: %tuple.bc2: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_5.0f6) [concrete]
|
|
|
-// CHECK:STDOUT: %.a89: type = fn_type_with_self_type %IndexWith.At.type.1ab, %IndexWith.facet [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.a69: %C = tuple_value () [concrete]
|
|
|
+// CHECK:STDOUT: %tuple.8e9: %tuple.type.56b = tuple_value (%empty_tuple.a69, %empty_tuple.a69) [concrete]
|
|
|
+// CHECK:STDOUT: %.7d9: type = fn_type_with_self_type %IndexWith.At.type.1ab, %IndexWith.facet [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: imports {
|
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
|
-// CHECK:STDOUT: .Int = %Core.Int
|
|
|
// CHECK:STDOUT: .IndexWith = %Core.IndexWith
|
|
|
// CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
|
|
|
-// CHECK:STDOUT: .Copy = %Core.Copy
|
|
|
-// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
|
|
// CHECK:STDOUT: import Core//prelude
|
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
|
// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
|
|
// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic]
|
|
|
// CHECK:STDOUT: %Core.import_ref.1f3: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type.a96) = import_ref Core//prelude/operators/index, loc{{\d+_\d+}}, loaded [symbolic = @IndexWith.%assoc0 (constants.%assoc0.fe9)]
|
|
|
// CHECK:STDOUT: %Core.import_ref.156: type = import_ref Core//prelude/operators/index, loc{{\d+_\d+}}, loaded [concrete = %ElementType]
|
|
|
// CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
|
|
|
// CHECK:STDOUT: %Core.import_ref.6c8 = import_ref Core//prelude/operators/index, loc{{\d+_\d+}}, unloaded
|
|
|
// CHECK:STDOUT: %ElementType: type = assoc_const_decl @ElementType [concrete] {}
|
|
|
-// CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/copy, Copy, loaded [concrete = constants.%Copy.type]
|
|
|
-// CHECK:STDOUT: %Core.import_ref.edf: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.413) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.2d6)]
|
|
|
-// CHECK:STDOUT: %Copy.impl_witness_table.e1c = impl_witness_table (%Core.import_ref.edf), @Int.as.Copy.impl [concrete]
|
|
|
-// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
|
|
-// CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.740)]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: file {
|
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
|
+// CHECK:STDOUT: .C = %C.decl
|
|
|
// CHECK:STDOUT: .s = %s
|
|
|
// CHECK:STDOUT: .e = %e
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
|
+// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
// CHECK:STDOUT: impl_decl @tuple.type.as.IndexWith.impl [concrete] {} {
|
|
|
-// CHECK:STDOUT: %int_32.loc4_7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32.loc4_7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %int_32.loc4_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32.loc4_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %.loc4_15.1: %tuple.type.24b = tuple_literal (%i32.loc4_7, %i32.loc4_12) [concrete = constants.%tuple.95a]
|
|
|
-// CHECK:STDOUT: %.loc4_15.2: type = converted %.loc4_15.1, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
|
|
-// CHECK:STDOUT: %Core.ref.loc4_20: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
|
|
+// CHECK:STDOUT: %C.ref.loc8_7: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %C.ref.loc8_10: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %.loc8_11.1: %tuple.type.24b = tuple_literal (%C.ref.loc8_7, %C.ref.loc8_10) [concrete = constants.%tuple.0d6]
|
|
|
+// CHECK:STDOUT: %.loc8_11.2: type = converted %.loc8_11.1, constants.%tuple.type.56b [concrete = constants.%tuple.type.56b]
|
|
|
+// CHECK:STDOUT: %Core.ref.loc8_16: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
|
|
// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic]
|
|
|
-// CHECK:STDOUT: %Core.ref.loc4_35: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
|
|
+// CHECK:STDOUT: %Core.ref.loc8_31: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
|
|
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
|
|
|
// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
|
|
|
-// CHECK:STDOUT: %.loc4_52.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
|
|
|
-// CHECK:STDOUT: %.loc4_52.2: type = converted %IntLiteral.call, %.loc4_52.1 [concrete = Core.IntLiteral]
|
|
|
+// CHECK:STDOUT: %.loc8_48.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
|
|
|
+// CHECK:STDOUT: %.loc8_48.2: type = converted %IntLiteral.call, %.loc8_48.1 [concrete = Core.IntLiteral]
|
|
|
// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(Core.IntLiteral)> [concrete = constants.%IndexWith.type.8ab]
|
|
|
// CHECK:STDOUT: %.Self: %IndexWith.type.8ab = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
|
|
// CHECK:STDOUT: %.Self.ref: %IndexWith.type.8ab = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
|
|
-// CHECK:STDOUT: %.loc4_60.1: %IndexWith.assoc_type.972 = specific_constant imports.%Core.import_ref.1f3, @IndexWith(Core.IntLiteral) [concrete = constants.%assoc0.b5d]
|
|
|
-// CHECK:STDOUT: %ElementType.ref: %IndexWith.assoc_type.972 = name_ref ElementType, %.loc4_60.1 [concrete = constants.%assoc0.b5d]
|
|
|
+// CHECK:STDOUT: %.loc8_56.1: %IndexWith.assoc_type.972 = specific_constant imports.%Core.import_ref.1f3, @IndexWith(Core.IntLiteral) [concrete = constants.%assoc0.b5d]
|
|
|
+// CHECK:STDOUT: %ElementType.ref: %IndexWith.assoc_type.972 = name_ref ElementType, %.loc8_56.1 [concrete = constants.%assoc0.b5d]
|
|
|
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.binding.as_type]
|
|
|
-// CHECK:STDOUT: %.loc4_60.2: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
|
|
|
+// CHECK:STDOUT: %.loc8_56.2: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.binding.as_type]
|
|
|
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%IndexWith.lookup_impl_witness.e03, element0 [symbolic_self = constants.%impl.elem0.f03]
|
|
|
-// CHECK:STDOUT: %int_32.loc4_75: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32.loc4_75: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %.loc4_54: type = where_expr %.Self [concrete = constants.%IndexWith_where.type] {
|
|
|
+// CHECK:STDOUT: %C.ref.loc8_71: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %.loc8_50: type = where_expr %.Self [concrete = constants.%IndexWith_where.type] {
|
|
|
// CHECK:STDOUT: requirement_base_facet_type constants.%IndexWith.type.8ab
|
|
|
-// CHECK:STDOUT: requirement_rewrite %impl.elem0, %i32.loc4_75
|
|
|
+// CHECK:STDOUT: requirement_rewrite %impl.elem0, %C.ref.loc8_71
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant, @tuple.type.as.IndexWith.impl.%tuple.type.as.IndexWith.impl.At.decl), @tuple.type.as.IndexWith.impl [concrete]
|
|
|
// CHECK:STDOUT: %IndexWith.impl_witness: <witness> = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness]
|
|
|
-// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%i32 [concrete = constants.%i32]
|
|
|
+// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%C [concrete = constants.%C]
|
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
|
-// CHECK:STDOUT: %s.patt: %pattern_type.511 = value_binding_pattern s [concrete]
|
|
|
+// CHECK:STDOUT: %s.patt: %pattern_type.99e = value_binding_pattern s [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %.loc10_17.1: type = splice_block %.loc10_17.3 [concrete = constants.%tuple.type.d07] {
|
|
|
-// CHECK:STDOUT: %int_32.loc10_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32.loc10_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %int_32.loc10_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32.loc10_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %.loc10_17.2: %tuple.type.24b = tuple_literal (%i32.loc10_9, %i32.loc10_14) [concrete = constants.%tuple.95a]
|
|
|
-// CHECK:STDOUT: %.loc10_17.3: type = converted %.loc10_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
|
|
|
+// CHECK:STDOUT: %.loc14_13.1: type = splice_block %.loc14_13.3 [concrete = constants.%tuple.type.56b] {
|
|
|
+// CHECK:STDOUT: %C.ref.loc14_9: type = name_ref C, %C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %C.ref.loc14_12: type = name_ref C, %C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %.loc14_13.2: %tuple.type.24b = tuple_literal (%C.ref.loc14_9, %C.ref.loc14_12) [concrete = constants.%tuple.0d6]
|
|
|
+// CHECK:STDOUT: %.loc14_13.3: type = converted %.loc14_13.2, constants.%tuple.type.56b [concrete = constants.%tuple.type.56b]
|
|
|
// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %impl.elem0.loc10_26.1: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
|
|
|
-// CHECK:STDOUT: %bound_method.loc10_26.1: <bound method> = bound_method @__global_init.%int_1, %impl.elem0.loc10_26.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.3d4]
|
|
|
-// CHECK:STDOUT: %specific_fn.loc10_26.1: <specific function> = specific_function %impl.elem0.loc10_26.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
-// CHECK:STDOUT: %bound_method.loc10_26.2: <bound method> = bound_method @__global_init.%int_1, %specific_fn.loc10_26.1 [concrete = constants.%bound_method.d3a]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_26.1: init %i32 = call %bound_method.loc10_26.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2]
|
|
|
-// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_26.1 [concrete = constants.%int_1.5d2]
|
|
|
-// CHECK:STDOUT: %.loc10_26.2: %i32 = converted @__global_init.%int_1, %.loc10_26.1 [concrete = constants.%int_1.5d2]
|
|
|
-// CHECK:STDOUT: %impl.elem0.loc10_26.2: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
|
|
|
-// CHECK:STDOUT: %bound_method.loc10_26.3: <bound method> = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b1d]
|
|
|
-// CHECK:STDOUT: %specific_fn.loc10_26.2: <specific function> = specific_function %impl.elem0.loc10_26.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
-// CHECK:STDOUT: %bound_method.loc10_26.4: <bound method> = bound_method @__global_init.%int_5, %specific_fn.loc10_26.2 [concrete = constants.%bound_method.06d]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_26.2: init %i32 = call %bound_method.loc10_26.4(@__global_init.%int_5) [concrete = constants.%int_5.0f6]
|
|
|
-// CHECK:STDOUT: %.loc10_26.3: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_26.2 [concrete = constants.%int_5.0f6]
|
|
|
-// CHECK:STDOUT: %.loc10_26.4: %i32 = converted @__global_init.%int_5, %.loc10_26.3 [concrete = constants.%int_5.0f6]
|
|
|
-// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc10_26.2, %.loc10_26.4) [concrete = constants.%tuple.bc2]
|
|
|
-// CHECK:STDOUT: %.loc10_26.5: %tuple.type.d07 = converted @__global_init.%.loc10, %tuple [concrete = constants.%tuple.bc2]
|
|
|
-// CHECK:STDOUT: %s: %tuple.type.d07 = value_binding s, %.loc10_26.5
|
|
|
+// CHECK:STDOUT: %tuple.loc14: %tuple.type.56b = tuple_value (@__global_init.%.loc14_21.2, @__global_init.%.loc14_30.2) [concrete = constants.%tuple.8e9]
|
|
|
+// CHECK:STDOUT: %.loc14_34: %tuple.type.56b = converted @__global_init.%.loc14_34, %tuple.loc14 [concrete = constants.%tuple.8e9]
|
|
|
+// CHECK:STDOUT: %s: %tuple.type.56b = value_binding s, %.loc14_34
|
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
|
-// CHECK:STDOUT: %e.patt: %pattern_type.7ce = value_binding_pattern e [concrete]
|
|
|
+// CHECK:STDOUT: %e.patt: %pattern_type.c48 = value_binding_pattern e [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %.loc11_8: type = splice_block %i32.loc11 [concrete = constants.%i32] {
|
|
|
-// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %.loc11_17.1: %i32 = value_of_initializer @__global_init.%tuple.type.as.IndexWith.impl.At.call
|
|
|
-// CHECK:STDOUT: %.loc11_17.2: %i32 = converted @__global_init.%tuple.type.as.IndexWith.impl.At.call, %.loc11_17.1
|
|
|
-// CHECK:STDOUT: %e: %i32 = value_binding e, %.loc11_17.2
|
|
|
+// CHECK:STDOUT: %C.ref.loc15: type = name_ref C, %C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %.loc15_15.1: init %empty_tuple.type = as_compatible @__global_init.%tuple.type.as.IndexWith.impl.At.call
|
|
|
+// CHECK:STDOUT: %.loc15_15.2: ref %empty_tuple.type = temporary_storage
|
|
|
+// CHECK:STDOUT: %.loc15_15.3: ref %empty_tuple.type = temporary %.loc15_15.2, %.loc15_15.1
|
|
|
+// CHECK:STDOUT: %tuple.loc15: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %.loc15_15.4: %C = as_compatible %tuple.loc15 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %.loc15_15.5: %C = converted @__global_init.%tuple.type.as.IndexWith.impl.At.call, %.loc15_15.4 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %e: %C = value_binding e, %.loc15_15.5
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: impl @tuple.type.as.IndexWith.impl: %.loc4_15.2 as %.loc4_54 {
|
|
|
+// CHECK:STDOUT: impl @tuple.type.as.IndexWith.impl: %.loc8_11.2 as %.loc8_50 {
|
|
|
// CHECK:STDOUT: %tuple.type.as.IndexWith.impl.At.decl: %tuple.type.as.IndexWith.impl.At.type = fn_decl @tuple.type.as.IndexWith.impl.At [concrete = constants.%tuple.type.as.IndexWith.impl.At] {
|
|
|
-// CHECK:STDOUT: %self.patt: %pattern_type.511 = value_binding_pattern self [concrete]
|
|
|
-// CHECK:STDOUT: %self.param_patt: %pattern_type.511 = value_param_pattern %self.patt, call_param0 [concrete]
|
|
|
+// CHECK:STDOUT: %self.patt: %pattern_type.99e = value_binding_pattern self [concrete]
|
|
|
+// CHECK:STDOUT: %self.param_patt: %pattern_type.99e = value_param_pattern %self.patt, call_param0 [concrete]
|
|
|
// CHECK:STDOUT: %subscript.patt: %pattern_type.dc0 = value_binding_pattern subscript [concrete]
|
|
|
// CHECK:STDOUT: %subscript.param_patt: %pattern_type.dc0 = value_param_pattern %subscript.patt, call_param1 [concrete]
|
|
|
-// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
|
|
|
-// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete]
|
|
|
+// CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
|
|
|
+// CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param2 [concrete]
|
|
|
// CHECK:STDOUT: } {
|
|
|
-// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %self.param: %tuple.type.d07 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, @tuple.type.as.IndexWith.impl.%.loc4_15.2 [concrete = constants.%tuple.type.d07]
|
|
|
-// CHECK:STDOUT: %self: %tuple.type.d07 = value_binding self, %self.param
|
|
|
+// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %self.param: %tuple.type.56b = value_param call_param0
|
|
|
+// CHECK:STDOUT: %Self.ref: type = name_ref Self, @tuple.type.as.IndexWith.impl.%.loc8_11.2 [concrete = constants.%tuple.type.56b]
|
|
|
+// CHECK:STDOUT: %self: %tuple.type.56b = value_binding self, %self.param
|
|
|
// CHECK:STDOUT: %subscript.param: Core.IntLiteral = value_param call_param1
|
|
|
-// CHECK:STDOUT: %.loc5_48.1: type = splice_block %.loc5_48.3 [concrete = Core.IntLiteral] {
|
|
|
+// CHECK:STDOUT: %.loc9_48.1: type = splice_block %.loc9_48.3 [concrete = Core.IntLiteral] {
|
|
|
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
|
|
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
|
|
|
// CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
|
|
|
-// CHECK:STDOUT: %.loc5_48.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
|
|
|
-// CHECK:STDOUT: %.loc5_48.3: type = converted %IntLiteral.call, %.loc5_48.2 [concrete = Core.IntLiteral]
|
|
|
+// CHECK:STDOUT: %.loc9_48.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
|
|
|
+// CHECK:STDOUT: %.loc9_48.3: type = converted %IntLiteral.call, %.loc9_48.2 [concrete = Core.IntLiteral]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %subscript: Core.IntLiteral = value_binding subscript, %subscript.param
|
|
|
-// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
|
|
-// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
|
|
+// CHECK:STDOUT: %return.param: ref %C = out_param call_param2
|
|
|
+// CHECK:STDOUT: %return: ref %C = return_slot %return.param
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .C = <poisoned>
|
|
|
// CHECK:STDOUT: .At = %tuple.type.as.IndexWith.impl.At.decl
|
|
|
// CHECK:STDOUT: witness = file.%IndexWith.impl_witness
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: fn @tuple.type.as.IndexWith.impl.At(%self.param: %tuple.type.d07, %subscript.param: Core.IntLiteral) -> %i32 {
|
|
|
+// CHECK:STDOUT: class @C {
|
|
|
+// CHECK:STDOUT: %.loc5_10: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %.loc5_11: type = converted %.loc5_10, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
|
+// CHECK:STDOUT: adapt_decl %.loc5_11 [concrete]
|
|
|
+// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_tuple.type [concrete = constants.%complete_type]
|
|
|
+// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = constants.%C
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @tuple.type.as.IndexWith.impl.At(%self.param: %tuple.type.56b, %subscript.param: Core.IntLiteral) -> %C {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
-// CHECK:STDOUT: %self.ref: %tuple.type.d07 = name_ref self, %self
|
|
|
+// CHECK:STDOUT: %self.ref: %tuple.type.56b = name_ref self, %self
|
|
|
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
|
|
-// CHECK:STDOUT: %tuple.elem0: %i32 = tuple_access %self.ref, element0
|
|
|
-// CHECK:STDOUT: %impl.elem0: %.fe5 = impl_witness_access constants.%Copy.impl_witness.09c, element0 [concrete = constants.%Int.as.Copy.impl.Op.c85]
|
|
|
-// CHECK:STDOUT: %bound_method.loc6_16.1: <bound method> = bound_method %tuple.elem0, %impl.elem0
|
|
|
-// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
|
|
-// CHECK:STDOUT: %bound_method.loc6_16.2: <bound method> = bound_method %tuple.elem0, %specific_fn
|
|
|
-// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_16.2(%tuple.elem0)
|
|
|
-// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
|
|
|
+// CHECK:STDOUT: %tuple.elem0: %C = tuple_access %self.ref, element0
|
|
|
+// CHECK:STDOUT: %.loc10_18.1: %empty_tuple.type = as_compatible %tuple.elem0
|
|
|
+// CHECK:STDOUT: %.loc10_18.2: ref %empty_tuple.type = as_compatible %return
|
|
|
+// CHECK:STDOUT: %.loc10_18.3: init %empty_tuple.type = tuple_init () to %.loc10_18.2 [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %.loc10_18.4: init %C = as_compatible %.loc10_18.3 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %.loc10_18.5: init %C = converted %tuple.elem0, %.loc10_18.4 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: return %.loc10_18.5 to %return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
-// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
|
|
-// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
|
|
|
-// CHECK:STDOUT: %.loc10: %tuple.type.f94 = tuple_literal (%int_1, %int_5) [concrete = constants.%tuple.f6b]
|
|
|
-// CHECK:STDOUT: %s.ref: %tuple.type.d07 = name_ref s, file.%s
|
|
|
+// CHECK:STDOUT: %.loc14_19: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %C.ref.loc14_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %empty_tuple.loc14_19: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %.loc14_21.1: %C = as_compatible %empty_tuple.loc14_19 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %.loc14_21.2: %C = converted %.loc14_19, %.loc14_21.1 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %.loc14_28: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %C.ref.loc14_33: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
+// CHECK:STDOUT: %empty_tuple.loc14_28: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple.af4]
|
|
|
+// CHECK:STDOUT: %.loc14_30.1: %C = as_compatible %empty_tuple.loc14_28 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %.loc14_30.2: %C = converted %.loc14_28, %.loc14_30.1 [concrete = constants.%empty_tuple.a69]
|
|
|
+// CHECK:STDOUT: %.loc14_34: %tuple.type.56b = tuple_literal (%.loc14_21.2, %.loc14_30.2) [concrete = constants.%tuple.8e9]
|
|
|
+// CHECK:STDOUT: %s.ref: %tuple.type.56b = name_ref s, file.%s
|
|
|
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
|
|
-// CHECK:STDOUT: %impl.elem1: %.a89 = impl_witness_access constants.%IndexWith.impl_witness, element1 [concrete = constants.%tuple.type.as.IndexWith.impl.At]
|
|
|
+// CHECK:STDOUT: %impl.elem1: %.7d9 = impl_witness_access constants.%IndexWith.impl_witness, element1 [concrete = constants.%tuple.type.as.IndexWith.impl.At]
|
|
|
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.ref, %impl.elem1
|
|
|
-// CHECK:STDOUT: %tuple.type.as.IndexWith.impl.At.call: init %i32 = call %bound_method(%s.ref, %int_0)
|
|
|
+// CHECK:STDOUT: %tuple.type.as.IndexWith.impl.At.call: init %C = call %bound_method(%s.ref, %int_0)
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|