fail_in_interface.carbon 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/none.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_in_interface.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_in_interface.carbon
  12. interface I {
  13. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:11: error: found runtime binding pattern in associated constant declaration; expected a `:!` binding [ExpectedSymbolicBindingInAssociatedConstant]
  14. // CHECK:STDERR: let var a: ();
  15. // CHECK:STDERR: ^~~~~
  16. // CHECK:STDERR:
  17. let var a: ();
  18. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:7: error: found runtime binding pattern in associated constant declaration; expected a `:!` binding [ExpectedSymbolicBindingInAssociatedConstant]
  19. // CHECK:STDERR: var b: ();
  20. // CHECK:STDERR: ^~~~~
  21. // CHECK:STDERR:
  22. var b: ();
  23. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+8]]:11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  24. // CHECK:STDERR: let var c:! ();
  25. // CHECK:STDERR: ^~~~~~
  26. // CHECK:STDERR:
  27. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:17: error: `var` pattern cannot declare a compile-time binding [CompileTimeBindingInVarDecl]
  28. // CHECK:STDERR: let var c:! ();
  29. // CHECK:STDERR: ^
  30. // CHECK:STDERR:
  31. let var c:! ();
  32. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:13: error: `var` pattern cannot declare a compile-time binding [CompileTimeBindingInVarDecl]
  33. // CHECK:STDERR: var d:! ();
  34. // CHECK:STDERR: ^
  35. // CHECK:STDERR:
  36. var d:! ();
  37. }