fail_simple_rewrite_cycle_2.carbon 710 B

123456789101112131415161718192021
  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. package ExplorerTest api;
  7. interface TwoTypes {
  8. let T:! type;
  9. let U:! type;
  10. }
  11. // Attempting to fully resolve the replacement for `.T` would never create a
  12. // situation where `.T`'s expansion involves `.T`. Ensure we catch this anyway.
  13. // CHECK:STDERR: COMPILATION ERROR: fail_simple_rewrite_cycle_2.carbon:[[@LINE+1]]: rewrite of (X).(TwoTypes.U) applies within its own resolved expansion of (X).(TwoTypes.U)*
  14. fn F[X:! TwoTypes where .U = .U* and .T = .U]() {}
  15. fn Main() -> i32 {
  16. return 0;
  17. }