Track an interface type, not an interface ID, on an associated entity. (#4188)

This prepares us for modeling associated entities of parameterized
interfaces.

We don't use the interface parameters when type-checking `impl`s or uses
of interface members yet, but we do now check interface arguments during
`impl` lookup.
This commit is contained in:
Richard Smith
2024-08-05 20:45:14 +00:00
committed by GitHub
parent 183c8c0ccf
commit 8a8c227163
73 changed files with 729 additions and 166 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ var arr: [i32; 1.(I.F)(2)];
// CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
// CHECK:STDOUT: %.2: type = tuple_type () [template]
// CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
// CHECK:STDOUT: %.3: type = assoc_entity_type @I, %F.type.1 [template]
// CHECK:STDOUT: %.3: type = assoc_entity_type %.1, %F.type.1 [template]
// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @I.%F.decl [template]
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
@@ -40,7 +40,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic]
// CHECK:STDOUT: %Op.type: type = fn_type @Op [template]
// CHECK:STDOUT: %Op: %Op.type = struct_value () [template]
// CHECK:STDOUT: %.3: type = assoc_entity_type @Add, %Op.type [template]
// CHECK:STDOUT: %.3: type = assoc_entity_type %.2, %Op.type [template]
// CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @Add.%Op.decl [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -108,7 +108,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4);
// CHECK:STDOUT: %.3: <witness> = interface_witness (%Op.1) [template]
// CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
// CHECK:STDOUT: %.5: i32 = int_literal 2 [template]
// CHECK:STDOUT: %.6: type = assoc_entity_type @Add, %Op.type.2 [template]
// CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Op.type.2 [template]
// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template]
// CHECK:STDOUT: %.8: <bound method> = bound_method %.4, %Op.1 [template]
// CHECK:STDOUT: %.9: i32 = int_literal 3 [template]