fail_aliased_name_in_diag.carbon 1.0 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. alias b = bool;
  7. // CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: ERROR: Cannot implicitly convert from `i32` to `bool`.
  8. // CHECK:STDERR: let c: b = 2;
  9. // CHECK:STDERR: ^~~~~~~~~~~~~
  10. let c: b = 2;
  11. // CHECK:STDOUT: --- fail_aliased_name_in_diag.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %.1: i32 = int_literal 2 [template]
  15. // CHECK:STDOUT: }
  16. // CHECK:STDOUT:
  17. // CHECK:STDOUT: file {
  18. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  19. // CHECK:STDOUT: .b = %b
  20. // CHECK:STDOUT: }
  21. // CHECK:STDOUT: %b: type = bind_alias b, bool [template = bool]
  22. // CHECK:STDOUT: %b.ref: type = name_ref b, %b [template = bool]
  23. // CHECK:STDOUT: %.loc11: i32 = int_literal 2 [template = constants.%.1]
  24. // CHECK:STDOUT: %c: bool = bind_name c, <error>
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: