fail_qualifier_unsupported.carbon 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/fail_qualifier_unsupported.carbon
  10. // CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+4]]:10: error: type `bool` does not support qualified expressions [QualifiedExprUnsupported]
  11. // CHECK:STDERR: fn F() { true.b; }
  12. // CHECK:STDERR: ^~~~~~
  13. // CHECK:STDERR:
  14. fn F() { true.b; }
  15. // CHECK:STDOUT: --- fail_qualifier_unsupported.carbon
  16. // CHECK:STDOUT:
  17. // CHECK:STDOUT: constants {
  18. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  19. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  20. // CHECK:STDOUT: %true: bool = bool_literal true [template]
  21. // CHECK:STDOUT: }
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: file {
  24. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  25. // CHECK:STDOUT: .F = %F.decl
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: fn @F() {
  31. // CHECK:STDOUT: !entry:
  32. // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true]
  33. // CHECK:STDOUT: return
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT: