fail_with_identifier_as_param.carbon 1.2 KB

123456789101112131415161718192021222324
  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:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: ERROR: Expected parameter declaration.
  7. // CHECK:STDERR: fn foo(bar);
  8. // CHECK:STDERR: ^
  9. fn foo(bar);
  10. // CHECK:STDOUT: - filename: fail_with_identifier_as_param.carbon
  11. // CHECK:STDOUT: parse_tree: [
  12. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  13. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  14. // CHECK:STDOUT: {kind: 'Name', text: 'foo'},
  15. // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
  16. // CHECK:STDOUT: {kind: 'Name', text: 'bar'},
  17. // CHECK:STDOUT: {kind: 'InvalidParse', text: ')', has_error: yes},
  18. // CHECK:STDOUT: {kind: 'PatternBinding', text: 'bar', has_error: yes, subtree_size: 3},
  19. // CHECK:STDOUT: {kind: 'ParameterList', text: ')', has_error: yes, subtree_size: 5},
  20. // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 8},
  21. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  22. // CHECK:STDOUT: ]