Relax alias restrictions. (#7190)

Implement the alias rules from proposal #5389, wherein an alias is
permitted so long as the target has a constant value. While that
proposal is not yet accepted, this seems like a reasonable basis for
further iteration, and will be useful for the examples we're currently
pursuing.
This commit is contained in:
Richard Smith
2026-05-12 17:22:44 +00:00
committed by GitHub
parent d4063cad65
commit dd7cfdb149
35 changed files with 262 additions and 219 deletions
@@ -118,7 +118,7 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %MyCpp: <namespace> = alias_binding MyCpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %MyCpp: <namespace> = alias_binding MyCpp, %Cpp.ref [concrete = imports.%Cpp]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- api_and_impl.carbon