fail_lookup_outside_scope.carbon 878 B

1234567891011121314151617181920212223
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/fail_lookup_outside_scope.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_lookup_outside_scope.carbon
  12. // --- fail_basic.carbon
  13. fn Main() {
  14. var unused x: ();
  15. }
  16. // CHECK:STDERR: fail_basic.carbon:[[@LINE+4]]:13: error: name `x` not found [NameNotFound]
  17. // CHECK:STDERR: var y: () = x;
  18. // CHECK:STDERR: ^
  19. // CHECK:STDERR:
  20. var y: () = x;