mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
ImplWitness (#4679)
* Change `InterfaceWitness` -> `ImplWitness` * Include a `SpecificId` in the `ImplWitness`. This allows the `InstBlock` it contains to have its own identity, allowing it to be changed as the impl is processed. Evaluation only updates the specific. * Create the `ImplWitness` at the start of the impl definition. In the future, this will be populated with the values of non-function associated constants. For now, it starts full of invalid instruction ids. * Implements the model suggested in #4672 . Note that the non-SemIR testdata changes are to these file: * `toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon` * `toolchain/check/testdata/struct/import.carbon` * `toolchain/check/testdata/tuple/import.carbon` The last two are due to an import of generics bug exposed by this PR, which will be fixed in a follow-on. --------- Co-authored-by: Josh L <josh11b@users.noreply.github.com> Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Josh L
Richard Smith
parent
4a7aefefaa
commit
c5fd8f42b8
@@ -115,7 +115,7 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
// there was an error in the qualifier, we will have lost track of the
|
||||
// interface name here. We should keep track of it even if the name is
|
||||
// invalid.
|
||||
interface_info.generic_id = FinishGenericDecl(context, interface_decl_id);
|
||||
interface_info.generic_id = BuildGenericDecl(context, interface_decl_id);
|
||||
interface_decl.interface_id = context.interfaces().Add(interface_info);
|
||||
if (interface_info.has_parameters()) {
|
||||
interface_decl.type_id = context.GetGenericInterfaceType(
|
||||
|
||||
Reference in New Issue
Block a user