fail_no_parens.carbon 3.1 KB

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