mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +01:00
Form the contents of the witness table. (#3756)
Check that functions in an `impl` are declared properly. For now, simply reuse the redeclaration checking logic. Longer-term, we need to check that the signatures match in a more approximate way, after substituting the `Self` type into the signature in the `interface`. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
551a6d385e
commit
a1317e61e0
@@ -173,6 +173,12 @@ static auto CheckRedecl(Context& context, const SemIR::Function& new_function,
|
||||
return true;
|
||||
}
|
||||
|
||||
auto CheckFunctionRedecl(Context& context, SemIR::FunctionId new_function_id,
|
||||
SemIR::FunctionId prev_function_id) -> bool {
|
||||
return CheckRedecl(context, context.functions().Get(new_function_id),
|
||||
context.functions().Get(prev_function_id));
|
||||
}
|
||||
|
||||
auto MergeFunctionRedecl(Context& context, Parse::NodeId parse_node,
|
||||
SemIR::Function& new_function,
|
||||
SemIR::FunctionId prev_function_id, bool is_definition)
|
||||
|
||||
Reference in New Issue
Block a user