fail_assoc_const_not_constant.carbon 1.1 KB

12345678910111213141516171819202122232425
  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/interface/fail_assoc_const_not_constant.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon
  12. interface I {
  13. // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+4]]:7: error: found runtime binding pattern in associated constant declaration; expected a `:!` binding [ExpectedSymbolicBindingInAssociatedConstant]
  14. // CHECK:STDERR: let a: {.b: ()};
  15. // CHECK:STDERR: ^~~~~~~~~~~
  16. // CHECK:STDERR:
  17. let a: {.b: ()};
  18. }
  19. // We shouldn't issue further errors on uses of the invalid name.
  20. alias UseA = I.a;
  21. // Ideally we would still diagnose this, but it's OK that we don't.
  22. alias UseOther = I.other;