fail_missing_deduced_close.carbon 1.2 KB

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