Sorting out how bindings are added to name lookup. (#2869)

This shifts logic so that bindings are added to name lookup only after the scope is complete, removing logic around adding/removing/re-adding names in certain scopes.

This does mean that things like a function's forward declaration will need to go through an extra hoop for name conflict checks, because under this approach a function definition does conflict checking when it adds names for the body's use. But, that seems easy to address, and better than the current hoops.
This commit is contained in:
Jon Ross-Perkins
2023-06-01 16:50:34 -07:00
committed by GitHub
parent a1a7251716
commit 39f7aae98d
76 changed files with 484 additions and 620 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ TEST(SemanticsIRTest, YAML) {
Yaml::Value::FromText(print_output),
ElementsAre(Yaml::Mapping(ElementsAre(
Pair("cross_reference_irs_size", "1"),
Pair("callables", Yaml::Sequence(IsEmpty())),
Pair("functions", Yaml::Sequence(IsEmpty())),
Pair("integer_literals", Yaml::Sequence(ElementsAre("0"))),
Pair("real_literals", Yaml::Sequence(IsEmpty())),
Pair("strings", Yaml::Sequence(ElementsAre("x"))),