lookup_scope.carbon 561 B

123456789101112131415161718192021
  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: 6
  9. package ExplorerTest api;
  10. namespace N;
  11. fn OuterI32() -> type { return i32; }
  12. fn One() -> i32 { return 1; }
  13. fn N.I32() -> type { return i32; }
  14. fn N.Five() -> I32() { return 5; }
  15. fn N.Six() -> OuterI32() { return Five() + One(); }
  16. fn Main() -> i32 { return N.Six(); }