fail_identifier_equals.carbon 1.2 KB

1234567891011121314151617181920212223
  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:STDOUT: [
  7. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  8. // CHECK:STDOUT: {kind: 'Name', text: 'x'},
  9. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  10. // CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'a', has_error: yes},
  11. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
  12. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 5},
  13. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  14. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  15. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
  16. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
  17. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  18. // CHECK:STDOUT: ]
  19. // CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: Expected `.field: field_type` or `.field = value`.
  20. // CHECK:STDERR: var x: {a=} = {};
  21. // CHECK:STDERR: ^
  22. var x: {a=} = {};