Files
carbon-lang/explorer/testdata/namespace/fail_namespace_alias.carbon
T
Richard Smith 6d4920148b Initial support for name lookup into namespaces. (#2572)
Name lookup into namespaces needs to be resolved early, as part of name resolution, so that we can properly diagnose references to entities before they are fully declared.  Make name resolution set a target `value_node` on simple member accesses that name namespace members, and in type-checking rewrite those member accesses into `IdentifierExpression`s that directly reference the namespace member.
2023-02-03 12:58:38 -08:00

21 lines
555 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;
fn N.F() {}
// TODO: This should work.
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/namespace/fail_namespace_alias.carbon:[[@LINE+1]]: could not find `namespace N;`
alias M = N;
fn Main() -> i32 {
M.F();
return 0;
}