Skip to content

Commit

Permalink
Checkpoint progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
josh11b committed Mar 3, 2025
1 parent 42fafd8 commit 74f2615
Show file tree
Hide file tree
Showing 10 changed files with 455 additions and 1,243 deletions.
67 changes: 22 additions & 45 deletions toolchain/check/testdata/impl/lookup/no_prelude/import.carbon

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.import_ref.f6b058.1: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_43, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)]
// CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)]
// CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_43, loaded [symbolic = @I.%F (constants.%F.bb2)]
Expand Down Expand Up @@ -760,7 +760,7 @@ fn H(c: C(InClassArgs)) { c.(I(X).F)(); }
// CHECK:STDOUT: %Main.import_ref.f6b058.2: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.884 = import_ref Main//types, inst26 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.cd3: @I.%I.assoc_type (%I.assoc_type.955) = import_ref Main//types, loc4_43, loaded [symbolic = @I.%assoc0 (constants.%assoc0.249)]
// CHECK:STDOUT: %Main.F: @I.%F.type (%F.type.2ae) = import_ref Main//types, F, loaded [symbolic = @I.%F (constants.%F.bb2)]
// CHECK:STDOUT: %Main.F = import_ref Main//types, F, unloaded
// CHECK:STDOUT: %Main.import_ref.f6b058.3: type = import_ref Main//types, loc4_13, loaded [symbolic = @I.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.38e: @I.%I.type (%I.type.325) = import_ref Main//types, inst26 [no loc], loaded [symbolic = @I.%Self (constants.%Self)]
// CHECK:STDOUT: %Main.import_ref.e54: @I.%F.type (%F.type.2ae) = import_ref Main//types, loc4_43, loaded [symbolic = @I.%F (constants.%F.bb2)]
Expand Down
7 changes: 3 additions & 4 deletions toolchain/check/testdata/impl/lookup/transitive.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,9 @@ fn Call() {
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type %I.type [concrete]
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, imports.%Main.import_ref.e03 [concrete]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.742) [concrete]
// CHECK:STDOUT: %F.type.cf0: type = fn_type @F.1 [concrete]
// CHECK:STDOUT: %F.bc6: %F.type.cf0 = struct_value () [concrete]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.742) [concrete]
// CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [concrete]
// CHECK:STDOUT: %.076: type = fn_type_with_self_type %F.type.cf0, %I.facet [concrete]
// CHECK:STDOUT: %F.type.5d6: type = fn_type @F.2 [concrete]
Expand All @@ -285,11 +284,11 @@ fn Call() {
// CHECK:STDOUT: %Main.import_ref.6a9 = import_ref Main//get, inst22 [indirect], unloaded
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//i, inst17 [no loc], unloaded
// CHECK:STDOUT: %Main.import_ref.bcb: %I.assoc_type = import_ref Main//i, loc4_33, loaded [concrete = constants.%assoc0]
// CHECK:STDOUT: %Main.F: %F.type.cf0 = import_ref Main//i, F, loaded [concrete = constants.%F.bc6]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: %Main.F = import_ref Main//i, F, unloaded
// CHECK:STDOUT: %Main.import_ref.e53: <witness> = import_ref Main//c, loc7_13, loaded [concrete = constants.%impl_witness]
// CHECK:STDOUT: %Main.import_ref.29a: type = import_ref Main//c, loc7_6, loaded [concrete = constants.%C]
// CHECK:STDOUT: %Main.import_ref.f50: type = import_ref Main//c, loc7_11, loaded [concrete = constants.%I.type]
// CHECK:STDOUT: %Main.import_ref.5dd: %I.type = import_ref Main//i, inst17 [no loc], loaded [symbolic = constants.%Self]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
224 changes: 25 additions & 199 deletions toolchain/check/testdata/impl/no_prelude/compound.carbon

Large diffs are not rendered by default.

34 changes: 16 additions & 18 deletions toolchain/check/testdata/impl/no_prelude/fail_impl_as_scope.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ fn F() {
// Even if the `impl` is diagnosed above, we must not add the impl of the
// interface to itself in a way that allows it to be used during impl lookup,
// or we end up with infinite impl lookup recursion here.
// CHECK:STDERR: fail_impl_as_self_interface.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Z` in type `type` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR: Point.(Z.Zero)();
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR:
Point.(Z.Zero)();
({} as Point).(Z.Method)();
}
Expand Down Expand Up @@ -236,7 +240,6 @@ class X {
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %.c03: type = fn_type_with_self_type %Zero.type.822, %Z.facet [concrete]
// CHECK:STDOUT: %Point.val: %Point = struct_value () [concrete]
// CHECK:STDOUT: %.6a1: type = fn_type_with_self_type %Method.type.f12, %Z.facet [concrete]
// CHECK:STDOUT: }
Expand Down Expand Up @@ -388,26 +391,21 @@ class X {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Point.ref.loc35: type = name_ref Point, file.%Point.decl [concrete = constants.%Point]
// CHECK:STDOUT: %Z.ref.loc35: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: %Point.ref.loc39: type = name_ref Point, file.%Point.decl [concrete = constants.%Point]
// CHECK:STDOUT: %Z.ref.loc39: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: %Zero.ref: %Z.assoc_type = name_ref Zero, @Z.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value constants.%Point, constants.%impl_witness [concrete = constants.%Z.facet]
// CHECK:STDOUT: %.loc35: %Z.type = converted %Point.ref.loc35, %Z.facet [concrete = constants.%Z.facet]
// CHECK:STDOUT: %as_wit: <witness> = facet_access_witness %.loc35 [concrete = constants.%impl_witness]
// CHECK:STDOUT: %impl.elem0: %.c03 = impl_witness_access %as_wit, element0 [concrete = constants.%Zero.dec]
// CHECK:STDOUT: %Zero.call: init %empty_tuple.type = call %impl.elem0()
// CHECK:STDOUT: %.loc36_5.1: %empty_struct_type = struct_literal ()
// CHECK:STDOUT: %Point.ref.loc36: type = name_ref Point, file.%Point.decl [concrete = constants.%Point]
// CHECK:STDOUT: %.loc36_5.2: ref %Point = temporary_storage
// CHECK:STDOUT: %.loc36_5.3: init %Point = class_init (), %.loc36_5.2 [concrete = constants.%Point.val]
// CHECK:STDOUT: %.loc36_5.4: ref %Point = temporary %.loc36_5.2, %.loc36_5.3
// CHECK:STDOUT: %.loc36_7.1: ref %Point = converted %.loc36_5.1, %.loc36_5.4
// CHECK:STDOUT: %Z.ref.loc36: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: %.loc40_5.1: %empty_struct_type = struct_literal ()
// CHECK:STDOUT: %Point.ref.loc40: type = name_ref Point, file.%Point.decl [concrete = constants.%Point]
// CHECK:STDOUT: %.loc40_5.2: ref %Point = temporary_storage
// CHECK:STDOUT: %.loc40_5.3: init %Point = class_init (), %.loc40_5.2 [concrete = constants.%Point.val]
// CHECK:STDOUT: %.loc40_5.4: ref %Point = temporary %.loc40_5.2, %.loc40_5.3
// CHECK:STDOUT: %.loc40_7.1: ref %Point = converted %.loc40_5.1, %.loc40_5.4
// CHECK:STDOUT: %Z.ref.loc40: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
// CHECK:STDOUT: %Method.ref: %Z.assoc_type = name_ref Method, @Z.%assoc1 [concrete = constants.%assoc1]
// CHECK:STDOUT: %impl.elem1: %.6a1 = impl_witness_access constants.%impl_witness, element1 [concrete = constants.%Method.2c2]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc36_7.1, %impl.elem1
// CHECK:STDOUT: %.loc36_7.2: %Point = bind_value %.loc36_7.1
// CHECK:STDOUT: %Method.call: init %empty_tuple.type = call %bound_method(%.loc36_7.2)
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc40_7.1, %impl.elem1
// CHECK:STDOUT: %.loc40_7.2: %Point = bind_value %.loc40_7.1
// CHECK:STDOUT: %Method.call: init %empty_tuple.type = call %bound_method(%.loc40_7.2)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
Expand Down
Loading

0 comments on commit 74f2615

Please sign in to comment.