fail_no_conversion.carbon 1.2 KB

12345678910111213141516171819202122232425262728
  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_conversion.carbon:[[@LINE+3]]:23: ERROR: Cannot convert from `i32` to `(i32, i32) as type` with `as`.
  7. // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32);
  8. // CHECK:STDERR: ^~
  9. let n: (i32, i32) = 1 as (i32, i32);
  10. // CHECK:STDOUT: --- fail_no_conversion.carbon
  11. // CHECK:STDOUT:
  12. // CHECK:STDOUT: constants {
  13. // CHECK:STDOUT: %.loc10_17.1: type = tuple_type (type, type)
  14. // CHECK:STDOUT: %.loc10_17.2: type = tuple_type (i32, i32)
  15. // CHECK:STDOUT: %.loc10_17.3: type = ptr_type (i32, i32)
  16. // CHECK:STDOUT: }
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: file {
  19. // CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32)
  20. // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.loc10_17.2
  21. // CHECK:STDOUT: %.loc10_21: i32 = int_literal 1
  22. // CHECK:STDOUT: %.loc10_35: (type, type) = tuple_literal (i32, i32)
  23. // CHECK:STDOUT: %.loc10_17.3: type = converted %.loc10_35, constants.%.loc10_17.2
  24. // CHECK:STDOUT: %n: (i32, i32) = bind_name n, <error>
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: