fail_assign_nested.carbon 960 B

123456789101112131415161718192021
  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_assign_nested.carbon:[[@LINE+3]]:28: Cannot implicitly convert from `{.b: {}}` to `{.a: {}}`.
  7. // CHECK:STDERR: var x: {.a: {}} = {.b = {}};
  8. // CHECK:STDERR: ^
  9. var x: {.a: {}} = {.b = {}};
  10. // CHECK:STDOUT: file "fail_assign_nested.carbon" {
  11. // CHECK:STDOUT: %.loc10_14.1: type = struct_type {}
  12. // CHECK:STDOUT: %.loc10_14.2: {} = struct_literal ()
  13. // CHECK:STDOUT: %.loc10_15: type = struct_type {.a: {}}
  14. // CHECK:STDOUT: %x: ref {.a: {}} = var "x"
  15. // CHECK:STDOUT: %.loc10_26: {} = struct_literal ()
  16. // CHECK:STDOUT: %.loc10_27.1: type = struct_type {.b: {}}
  17. // CHECK:STDOUT: %.loc10_27.2: {.b: {}} = struct_literal (%.loc10_26)
  18. // CHECK:STDOUT: assign %x, <error>
  19. // CHECK:STDOUT: }