fail_missing_deduced_close.carbon 1.6 KB

12345678910111213141516171819202122232425262728293031
  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. // Fix and uncomment this to test error handling.
  7. // CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+6]]:7: ERROR: Closing symbol does not match most recent opening symbol.
  8. // CHECK:STDERR: fn Div[();
  9. // CHECK:STDERR: ^
  10. // CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+3]]:8: ERROR: Expected parameter declaration.
  11. // CHECK:STDERR: fn Div[();
  12. // CHECK:STDERR: ^
  13. fn Div[();
  14. // CHECK:STDERR: fail_missing_deduced_close.carbon:[[@LINE+15]]:21: ERROR: A `(` for parameters is required after deduced parameters.
  15. // CHECK:STDERR: // CHECK:STDOUT: ]
  16. // CHECK:STDERR: ^
  17. // CHECK:STDOUT: - filename: fail_missing_deduced_close.carbon
  18. // CHECK:STDOUT: parse_tree: [
  19. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  20. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  21. // CHECK:STDOUT: {kind: 'Name', text: 'Div'},
  22. // CHECK:STDOUT: {kind: 'DeducedParameterListStart', text: '['},
  23. // CHECK:STDOUT: {kind: 'Name', text: '(', has_error: yes},
  24. // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes},
  25. // CHECK:STDOUT: {kind: 'PatternBinding', text: '(', has_error: yes, subtree_size: 3},
  26. // CHECK:STDOUT: {kind: 'DeducedParameterList', text: ']', has_error: yes, subtree_size: 5},
  27. // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 8},
  28. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  29. // CHECK:STDOUT: ]