mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 18:24:53 +01:00
Fixes https://github.com/carbon-language/carbon-lang/blob/46503c0a9d20d8e38dde1ff4266f4e2b98699669/explorer/interpreter/resolve_names.cpp#L281 This was super fun to implement as first contribution. Learnt a lot about how the interpreter works while digging through the code and trying different ways to fix it.
22 lines
650 B
Plaintext
22 lines
650 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
|
|
// RUN: %{not} %{explorer-run}
|
|
// RUN: %{not} %{explorer-run-trace}
|
|
|
|
package ExplorerTest api;
|
|
|
|
namespace N;
|
|
alias M = N;
|
|
// TODO: It's unclear whether this should be permitted. If not, we should
|
|
// produce a better diagnostic.
|
|
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/alias/fail_namespace_alias_member.carbon:[[@LINE+1]]: alias M cannot be used as a name qualifier
|
|
fn M.F() {}
|
|
|
|
fn Main() -> i32 {
|
|
N.F();
|
|
return 0;
|
|
}
|