namespace_alias.carbon 532 B

12345678910111213141516171819202122232425262728
  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. // RUN: %{explorer-run}
  7. // RUN: %{explorer-run-trace}
  8. // CHECK:STDOUT: result: 0
  9. package ExplorerTest api;
  10. namespace N;
  11. namespace N.M;
  12. fn N.F() {}
  13. fn N.M.FM() {}
  14. alias A = N;
  15. alias AM = N.M;
  16. alias N.A = N.M;
  17. alias N.A2 = N;
  18. fn Main() -> i32 {
  19. A.F();
  20. AM.FM();
  21. N.A.FM();
  22. A.A2.A2.A2.A2.A2.A2.A2.F();
  23. return 0;
  24. }