mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-25 04:42:39 +00:00
Canonicalize the self in ImplSelfWitness (#7898)
We perform the same canonicalization as in LookupImplWitness, which makes the output of eval more consistent across witness types, and enables more straightforward constant comparisons between them when needed.
This commit is contained in:
1 parent
f83518bfd7
commit
bf91a8b4dd
13 files changed
+81
-72
No files matched your search
@@ -268,8 +268,8 @@ static auto BuildImplDecl(Context& context, Parse::AnyImplDeclId node_id,
|
||||
// are applied to the impl.
|
||||
//
|
||||
// We can use ImplSelfWitness for this because it contains a
|
||||
// SpecificInterfaceId operand, and it has a constant_kind of `Always` so it
|
||||
// never evaluates to some other type of inst.
|
||||
// SpecificInterfaceId operand, and it always evaluates an inst of the same
|
||||
// kind so we don't lose the operand.
|
||||
//
|
||||
// TODO: We could avoid the extra indirection through a SpecificInterfaceId if
|
||||
// we introduced a new instruction with a SpecificId operand instead of
|
||||
|
||||
Reference in new issue
Block a user