mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
Treat the empty inst block as being canonical. (#4199)
TryEvalInst was assuming this to be the case when forming canonical constants, but it previously wasn't. This fixes an issue where we can end up with two identical-looking constants for an empty struct value: one with an `Empty` block and another with the canonical empty block.
This commit is contained in:
@@ -94,8 +94,7 @@ TEST(SemIRTest, YAML) {
|
||||
Pair("import_refs", Yaml::Mapping(IsEmpty())),
|
||||
Pair("global_init", Yaml::Mapping(IsEmpty())),
|
||||
Pair("block4", Yaml::Mapping(Each(Pair(_, inst_id)))),
|
||||
Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id)))),
|
||||
Pair("block6", Yaml::Mapping(Each(Pair(_, inst_id)))))))));
|
||||
Pair("block5", Yaml::Mapping(Each(Pair(_, inst_id)))))))));
|
||||
|
||||
auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping(
|
||||
ElementsAre(Pair("filename", "test.carbon"), Pair("sem_ir", file)))));
|
||||
|
||||
Reference in New Issue
Block a user