fail_arrow.carbon 1.2 KB

123456789101112131415161718192021222324252627
  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. namespace Foo;
  7. // CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:7: `fn` requires a `(` for parameters.
  8. // CHECK:STDERR: fn Foo->Bar() {}
  9. // CHECK:STDERR: ^
  10. fn Foo->Bar() {}
  11. // CHECK:STDOUT: [
  12. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  13. // CHECK:STDOUT: {kind: 'Name', text: 'Foo'},
  14. // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 3},
  15. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  16. // CHECK:STDOUT: {kind: 'Name', text: 'Foo'},
  17. // CHECK:STDOUT: {kind: 'NameExpression', text: 'Bar'},
  18. // CHECK:STDOUT: {kind: 'CallExpressionStart', text: '(', subtree_size: 2},
  19. // CHECK:STDOUT: {kind: 'CallExpression', text: ')', subtree_size: 3},
  20. // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 4},
  21. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', has_error: yes, subtree_size: 7},
  22. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 8},
  23. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  24. // CHECK:STDOUT: ]