fail_no_parens.carbon 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_no_parens.carbon:[[@LINE+4]]:12: ERROR: A `(` for parameters is required after implicit parameters.
  7. // CHECK:STDERR: class Foo[];
  8. // CHECK:STDERR: ^
  9. // CHECK:STDERR:
  10. class Foo[];
  11. // CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: ERROR: A `(` for parameters is required after implicit parameters.
  12. // CHECK:STDERR: class Foo[a: i32];
  13. // CHECK:STDERR: ^
  14. // CHECK:STDERR:
  15. class Foo[a: i32];
  16. // CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: ERROR: A `(` for parameters is required after implicit parameters.
  17. // CHECK:STDERR: interface Bar[] {}
  18. // CHECK:STDERR: ^
  19. // CHECK:STDERR:
  20. interface Bar[] {}
  21. // CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: ERROR: A `(` for parameters is required after implicit parameters.
  22. // CHECK:STDERR: interface Bar[a: i32] {}
  23. // CHECK:STDERR: ^
  24. interface Bar[a: i32] {}
  25. // CHECK:STDOUT: - filename: fail_no_parens.carbon
  26. // CHECK:STDOUT: parse_tree: [
  27. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  28. // CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
  29. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Foo'},
  30. // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
  31. // CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 2},
  32. // CHECK:STDOUT: {kind: 'ClassDecl', text: ';', has_error: yes, subtree_size: 5},
  33. // CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'},
  34. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Foo'},
  35. // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
  36. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'a'},
  37. // CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
  38. // CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 3},
  39. // CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5},
  40. // CHECK:STDOUT: {kind: 'ClassDecl', text: ';', has_error: yes, subtree_size: 8},
  41. // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'},
  42. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Bar'},
  43. // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
  44. // CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 2},
  45. // CHECK:STDOUT: {kind: 'InterfaceDecl', text: '}', has_error: yes, subtree_size: 5},
  46. // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'},
  47. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'Bar'},
  48. // CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
  49. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'a'},
  50. // CHECK:STDOUT: {kind: 'IntTypeLiteral', text: 'i32'},
  51. // CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 3},
  52. // CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 5},
  53. // CHECK:STDOUT: {kind: 'InterfaceDecl', text: '}', has_error: yes, subtree_size: 8},
  54. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  55. // CHECK:STDOUT: ]