builtin_in_namespace.carbon 578 B

1234567891011121314151617181920
  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: 2
  9. package ExplorerTest api;
  10. namespace Namespace;
  11. // This does not interfere with the builtin `AddWith`, nor with the declaration
  12. // of `F` below.
  13. interface Namespace.AddWith {}
  14. fn F[T:! AddWith(i32) where .Result = i32](n: T) -> i32 { return n + 1; }
  15. fn Main() -> i32 { return F(1); }