fail_incomplete.carbon 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/fail_incomplete.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/fail_incomplete.carbon
  12. // --- fail_impl_lookup_incomplete.carbon
  13. library "[[@TEST_NAME]]";
  14. constraint Z;
  15. fn AsZ(T:! Z) {}
  16. fn F() {
  17. // Requires Z identified.
  18. // CHECK:STDERR: fail_impl_lookup_incomplete.carbon:[[@LINE+10]]:3: error: facet type `Z` can not be identified [ImplLookupInUnidentifiedFacetType]
  19. // CHECK:STDERR: AsZ(());
  20. // CHECK:STDERR: ^~~~~~~
  21. // CHECK:STDERR: fail_impl_lookup_incomplete.carbon:[[@LINE-9]]:1: note: constraint was forward declared here [NamedConstraintForwardDeclaredHere]
  22. // CHECK:STDERR: constraint Z;
  23. // CHECK:STDERR: ^~~~~~~~~~~~~
  24. // CHECK:STDERR: fail_impl_lookup_incomplete.carbon:[[@LINE-10]]:8: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  25. // CHECK:STDERR: fn AsZ(T:! Z) {}
  26. // CHECK:STDERR: ^
  27. // CHECK:STDERR:
  28. AsZ(());
  29. }