Add support for importing interfaces. (#3726)

Interface support is pretty skeletal so this may need additions later,
but I think it's still worthwhile to fill in the necessary bits now.
With this change, the expectation is then that everything we have right
now which _can_ be imported, is supported for import (at least for the
"current package, no overlap" case).
This commit is contained in:
Jon Ross-Perkins
2024-02-26 22:55:22 +00:00
committed by GitHub
parent d2056ef4b9
commit abe8ce6653
5 changed files with 148 additions and 35 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ auto HandleInterfaceDefinitionStart(
auto& interface_info = context.interfaces().Get(interface_id);
// Track that this declaration is the definition.
if (interface_info.definition_id.is_valid()) {
if (interface_info.is_defined()) {
CARBON_DIAGNOSTIC(InterfaceRedefinition, Error,
"Redefinition of interface {0}.", SemIR::NameId);
CARBON_DIAGNOSTIC(InterfacePreviousDefinition, Note,