fail_missing_deduced_close.carbon 1.4 KB

12345678910111213141516171819202122
  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. // CHECK:STDOUT: [
  7. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  8. // CHECK:STDOUT: {kind: 'DeclaredName', text: 'Div'},
  9. // CHECK:STDOUT: {kind: 'DeducedParameterListStart', text: '['},
  10. // CHECK:STDOUT: {kind: 'DeclaredName', text: '(', has_error: yes},
  11. // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes},
  12. // CHECK:STDOUT: {kind: 'PatternBinding', text: '(', has_error: yes, subtree_size: 3},
  13. // CHECK:STDOUT: {kind: 'DeducedParameterList', text: ']', has_error: yes, subtree_size: 5},
  14. // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 8},
  15. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  16. // CHECK:STDOUT: ]
  17. // Fix and uncomment this to test error handling.
  18. // CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+2]]:7: Closing symbol does not match most recent opening symbol.
  19. // CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+1]]:8: Expected parameter declaration.
  20. fn Div[();
  21. // CHECK:STDERR: toolchain/parser/testdata/function/declaration/fail_missing_deduced_close.carbon:[[@LINE+0]]:174: A `(` for parameters is required after deduced parameters.