from qiskit import QuantumCircuit

# NEGATIVE for GhostCompose: the result of compose() is captured in qc2, so
# the circuit is intentionally kept. The detector must NOT fire.
qc = QuantumCircuit(1, 1)
sub = QuantumCircuit(1, 1)
sub.h(0)
qc2 = qc.compose(sub)    # SAFE: return value captured -> no GhostCompose
