fail_namespace_alias_member.carbon 551 B

12345678910111213141516171819
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. package ExplorerTest api;
  7. namespace N;
  8. alias M = N;
  9. // TODO: It's unclear whether this should be permitted. If not, we should
  10. // produce a better diagnostic.
  11. // CHECK:STDERR: COMPILATION ERROR: fail_namespace_alias_member.carbon:[[@LINE+1]]: alias M cannot be used as a name qualifier
  12. fn M.F() {}
  13. fn Main() -> i32 {
  14. N.F();
  15. return 0;
  16. }