mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Allow simple uses of Self in impls. (#3824)
Per #3714, some of the details here are not yet settled. In particular, we might want `Self` to come into scope at the start of the definition, not at the `as` keyword. However, this change allows us to accept the uncontroversial examples.
This commit is contained in:
@@ -47,10 +47,9 @@ static auto CheckAssociatedFunctionImplementation(
|
||||
return SemIR::InstId::BuiltinError;
|
||||
}
|
||||
|
||||
// TODO: Substitute the `Self` from the `impl` into the type in the interface
|
||||
// before checking. Also, this should be a semantic check rather than a
|
||||
// syntactic one. The functions should be allowed to have different signatures
|
||||
// as long as we can synthesize a suitable thunk.
|
||||
// TODO: This should be a semantic check rather than a syntactic one. The
|
||||
// functions should be allowed to have different signatures as long as we can
|
||||
// synthesize a suitable thunk.
|
||||
if (!CheckFunctionTypeMatches(context, impl_function_decl->function_id,
|
||||
interface_function_id, substitutions)) {
|
||||
return SemIR::InstId::BuiltinError;
|
||||
|
||||
Reference in New Issue
Block a user