mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 02:22:42 +00:00
Adds `BindAlias` with a hybrid of `BindName` and `NameRef` semantics. I think it's slightly closer to `BindName` because it introduces a name, so I'm going more in that direction. This also matches the need for `bind_name_id` with imports on enclosing scopes. Note, only things that look like a name reference are being allowed on the RHS of `alias`. This includes builtins that look like name references, such as `bool`, but not ones that turn into values underneath, such as `false`.
19 lines
659 B
Plaintext
19 lines
659 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
|
|
// CHECK:STDERR: fail_todo_private.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `access modifier`.
|
|
// CHECK:STDERR: private alias A = i32;
|
|
// CHECK:STDERR: ^~~~~~~
|
|
private alias A = i32;
|
|
|
|
// CHECK:STDOUT: --- fail_todo_private.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace {.A = %A} [template]
|
|
// CHECK:STDOUT: %A: type = bind_alias A, i32 [template = i32]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|