forall.carbon 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. impl forall [T:! type] T as Interface;
  7. impl forall [T:! type, U:! Interface] U as Interface(T) {
  8. }
  9. // CHECK:STDOUT: - filename: forall.carbon
  10. // CHECK:STDOUT: parse_tree: [
  11. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  12. // CHECK:STDOUT: {kind: 'ImplIntroducer', text: 'impl'},
  13. // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
  14. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'T'},
  15. // CHECK:STDOUT: {kind: 'TypeTypeLiteral', text: 'type'},
  16. // CHECK:STDOUT: {kind: 'CompileTimeBindingPattern', text: ':!', subtree_size: 3},
  17. // CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5},
  18. // CHECK:STDOUT: {kind: 'ImplForall', text: 'forall', subtree_size: 6},
  19. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'T'},
  20. // CHECK:STDOUT: {kind: 'TypeImplAs', text: 'as', subtree_size: 2},
  21. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'Interface'},
  22. // CHECK:STDOUT: {kind: 'ImplDecl', text: ';', subtree_size: 11},
  23. // CHECK:STDOUT: {kind: 'ImplIntroducer', text: 'impl'},
  24. // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
  25. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'T'},
  26. // CHECK:STDOUT: {kind: 'TypeTypeLiteral', text: 'type'},
  27. // CHECK:STDOUT: {kind: 'CompileTimeBindingPattern', text: ':!', subtree_size: 3},
  28. // CHECK:STDOUT: {kind: 'PatternListComma', text: ','},
  29. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'U'},
  30. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'Interface'},
  31. // CHECK:STDOUT: {kind: 'CompileTimeBindingPattern', text: ':!', subtree_size: 3},
  32. // CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 9},
  33. // CHECK:STDOUT: {kind: 'ImplForall', text: 'forall', subtree_size: 10},
  34. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'U'},
  35. // CHECK:STDOUT: {kind: 'TypeImplAs', text: 'as', subtree_size: 2},
  36. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'Interface'},
  37. // CHECK:STDOUT: {kind: 'CallExprStart', text: '(', subtree_size: 2},
  38. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'T'},
  39. // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 4},
  40. // CHECK:STDOUT: {kind: 'ImplDefinitionStart', text: '{', subtree_size: 18},
  41. // CHECK:STDOUT: {kind: 'ImplDefinition', text: '}', subtree_size: 19},
  42. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  43. // CHECK:STDOUT: ]