fail_in_interface.carbon 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon
  10. interface I {
  11. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+8]]:7: error: found runtime binding pattern in associated constant declaration; expected a `:!` binding [ExpectedSymbolicBindingInAssociatedConstant]
  12. // CHECK:STDERR: var v: ();
  13. // CHECK:STDERR: ^~~~~
  14. // CHECK:STDERR:
  15. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:3: error: `var` declaration in interface [VarInInterfaceDecl]
  16. // CHECK:STDERR: var v: ();
  17. // CHECK:STDERR: ^~~~~~~~~~
  18. // CHECK:STDERR:
  19. var v: ();
  20. }
  21. // CHECK:STDOUT: --- fail_in_interface.carbon
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: constants {
  24. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  25. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: file {
  29. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  30. // CHECK:STDOUT: .I = %I.decl
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT:
  35. // CHECK:STDOUT: interface @I {
  36. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: !members:
  39. // CHECK:STDOUT: .Self = %Self
  40. // CHECK:STDOUT: witness = ()
  41. // CHECK:STDOUT: }
  42. // CHECK:STDOUT: