fail_no_conversion.carbon 1.4 KB

123456789101112131415161718192021222324252627282930
  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]]:21: ERROR: Cannot convert from `i32` to `(i32, i32)` 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: %.1: type = tuple_type (type, type) [template]
  14. // CHECK:STDOUT: %.2: type = tuple_type (i32, i32) [template]
  15. // CHECK:STDOUT: %.3: type = ptr_type (i32, i32) [template]
  16. // CHECK:STDOUT: %.4: i32 = int_literal 1 [template]
  17. // CHECK:STDOUT: }
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: file {
  20. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  21. // CHECK:STDOUT: %.loc10_17.1: (type, type) = tuple_literal (i32, i32)
  22. // CHECK:STDOUT: %.loc10_17.2: type = converted %.loc10_17.1, constants.%.2 [template = constants.%.2]
  23. // CHECK:STDOUT: %.loc10_21: i32 = int_literal 1 [template = constants.%.4]
  24. // CHECK:STDOUT: %.loc10_35.1: (type, type) = tuple_literal (i32, i32)
  25. // CHECK:STDOUT: %.loc10_35.2: type = converted %.loc10_35.1, constants.%.2 [template = constants.%.2]
  26. // CHECK:STDOUT: %n: (i32, i32) = bind_name n, <error>
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT: