fail_alternative_with_implicit_params.carbon 1.4 KB

12345678910111213141516171819202122232425262728
  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/parse/testdata/choice/fail_alternative_with_implicit_params.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon
  10. choice X {
  11. // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+4]]:4: error: expected `,` or `}` [UnexpectedTokenAfterListElement]
  12. // CHECK:STDERR: A[T:! type](value: T)
  13. // CHECK:STDERR: ^
  14. // CHECK:STDERR:
  15. A[T:! type](value: T)
  16. }
  17. // CHECK:STDOUT: - filename: fail_alternative_with_implicit_params.carbon
  18. // CHECK:STDOUT: parse_tree: [
  19. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  20. // CHECK:STDOUT: {kind: 'ChoiceIntroducer', text: 'choice'},
  21. // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'X'},
  22. // CHECK:STDOUT: {kind: 'ChoiceDefinitionStart', text: '{', subtree_size: 3},
  23. // CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'A'},
  24. // CHECK:STDOUT: {kind: 'ChoiceDefinition', text: '}', has_error: yes, subtree_size: 5},
  25. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  26. // CHECK:STDOUT: ]