non_instance_fn.carbon 1.1 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. // RUN: %{carbon-run-parser}
  7. // CHECK:STDOUT: [
  8. // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'},
  9. // CHECK:STDOUT: {kind: 'DeclaredName', text: 'Foo'},
  10. // CHECK:STDOUT: {kind: 'InterfaceDefinitionStart', text: '{', subtree_size: 3},
  11. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  12. // CHECK:STDOUT: {kind: 'DeclaredName', text: 'FooFactory'},
  13. // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
  14. // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2},
  15. // CHECK:STDOUT: {kind: 'SelfTypeIdentifier', text: 'Self'},
  16. // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2},
  17. // CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 7},
  18. // CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 11},
  19. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  20. // CHECK:STDOUT: ]
  21. interface Foo {
  22. fn FooFactory() -> Self;
  23. }