Files
swift-mirror/test/Interop/Cxx/stdlib/iterator-cycle-unrelated-operator.swift
Patryk Stefanski c5b9b6183d [cxx-interop] Add cycle warning test (NFC)
Reproducer for a cycle warning during iterator conformance derivation.
The cycle requires three structural properties:
1. A class-template iterator with a free-function operator==
2. An unrelated nested class with a member operator==
3. The nested class's parent has a field of a different specialization
   of the same iterator template

When all three are present, a module-wide operator== scan during
conformance derivation for one specialization can re-enter a mid-import
context for the other, triggering a cycle warning.
2026-05-05 15:54:45 -07:00

11 lines
360 B
Swift

// Verify that importing a module where an unrelated nested class has its own
// operator== does not produce a cycle warning during iterator conformance
// derivation.
// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=default -Xcc -std=c++17
// expected-no-diagnostics
import IteratorCycleUnrelatedOperator
typealias X = llvm.R