Repository: microsoft/qdk (Rust)

Issue:
Fuzz: "default node ID should be replaced: SpecDecl _id_ [2826-3043]: Gen: Slf" (ubuntu-latest)
The fuzz-testing workflow has detected a bug.

<details><summary><b>Auto-Minimized Fuzzing Input That Triggers the Bug:</b> Click this line.</summary>
<b>Note:</b> If the input is multi-line then the end-of-line characters '\n' (0x0A) and '\r' (0x0D)
may affect the reproducibility of the bug. If you fail to repro the bug with the input shown below
then you may want to go to the <a href=https://github.com/microsoft/qsharp/actions/runs/5674547995>workflow</a> that reported this GitHub bug,
download the artifact, and extract the file with the exact minimized input.

```qs
namespace s{operation y():Unit is Adj+ Ctl{body intrinsic;}}
```

</details>

<details><summary><b>Fuzzing <code>stderr</code> Log</b> (last 62kB), includes the stack trace: Click.</summary>
The fragment of interest starts with "panicked at".

```gdb
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifestnote: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest    Finished release [optimized + debuginfo] target(s) in 0.06swarning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifestnote: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest    Finished release [optimized + debuginfo] target(s) in 0.06s     Running `target/x86_64-unknown-linux-gnu/release/compile -artifact_prefix=/home/runner/work/qsharp/qsharp/fuzz/artifacts/compile/ '-seed_inputs=@fuzz/seed_inputs/compile/list.txt' -max_total_time=7200 -rss_limit_mb=4096 -max_len=20000 /home/runner/work/qsharp/qsharp/fuzz/corpus/compile`WARNING: Failed to find function "__sanitizer_acquire_crash_state".WARNING: Failed to find function "__sanitizer_print_stack_trace".WARNING: Failed to find function "__sanitizer_set_death_callback".INFO: Running with entropic power schedule (0xFF, 100).INFO: Seed: 266865877INFO: Loaded 1 modules   (135266 inline 8-bit counters): 135266 [0x55c060a0cb38, 0x55c060a2db9a), INFO: Loaded 1 PC tables (135266 PCs): 135266 [0x55c060a2dba0,0x55c060c3e1c0), INFO:        0 files found in /home/runner/work/qsharp/qsharp/fuzz/corpus/compileINFO: seed corpus: files: 1055 min: 37b max: 61518b total: 4163742b rss: 43Mb#512	pulse  cov: 6861 ft: 24729 corp: 378/250Kb exec/s: 256 rss: 45Mbthread '<unnamed>' panicked at 'default node ID should be replaced: SpecDecl _id_ [2826-3043]: Gen: Slf', compiler/qsc_hir/src/validate.rs:19:13stack backtrace:   0: rust_begin_unwind             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:617:5   1: core::panicking::panic_fmt             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/core/src/panicking.rs:67:14   2: qsc_hir::validate::Validator::check   3: <qsc_hir::validate::Validator as qsc_hir::visit::Visitor>::visit_spec_decl             at ./compiler/qsc_hir/src/validate.rs:35:9   4: qsc_hir::visit::walk_item             at ./compiler/qsc_hir/src/visit.rs:56:37   5: qsc_hir::visit::Visitor::visit_item             at ./compiler/qsc_hir/src/visit.rs:15:9   6: qsc_hir::visit::walk_package::{{closure}}             at ./compiler/qsc_hir/src/visit.rs:50:41   7: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/core/src/iter/traits/iterator.rs:853:29   8: core::iter::traits::iterator::Iterator::fold             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/core/src/iter/traits/iterator.rs:2481:21   9: core::iter::traits::iterator::Iterator::for_each             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/core/src/iter/traits/iterator.rs:856:9  10: qsc_hir::visit::walk_package             at ./compiler/qsc_hir/src/visit.rs:50:5  11: qsc_hir::visit::Visitor::visit_package             at ./compiler/qsc_hir/src/visit.rs:11:9  12: qsc_passes::run_default_passes             at ./compiler/qsc_passes/src/lib.rs:56:26  13: qsc::compile::compile             at ./compiler/qsc/src/compile.rs:32:22  14: compile::compile::{{closure}}             at ./fuzz/fuzz_targets/compile.rs:21:29  15: std::thread::local::LocalKey<T>::try_with             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/thread/local.rs:270:16  16: std::thread::local::LocalKey<T>::with             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/thread/local.rs:246:9  17: compile::compile             at ./fuzz/fuzz_targets/compile.rs:20:19  18: rust_fuzzer_test_input             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/src/lib.rs:224:17  19: libfuzzer_sys::test_input_wrap::{{closure}}             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/src/lib.rs:61:9  20: std::panicking::try::do_call             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:524:40  21: std::panicking::try             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:488:19  22: std::panic::catch_unwind             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panic.rs:142:14  23: LLVMFuzzerTestOneInput             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/src/lib.rs:59:22  24: _ZN6fuzzer6Fuzzer15ExecuteCallbackEPKhm             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/libfuzzer/FuzzerLoop.cpp:612:15  25: _ZN6fuzzer6Fuzzer6RunOneEPKhmbPNS_9InputInfoEbPb             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/libfuzzer/FuzzerLoop.cpp:514:22  26: _ZN6fuzzer6Fuzzer25ReadAndExecuteSeedCorporaERSt6vectorINS_9SizedFileESaIS2_EE             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/libfuzzer/FuzzerLoop.cpp:827:13  27: _ZN6fuzzer6Fuzzer4LoopERSt6vectorINS_9SizedFileESaIS2_EE             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/libfuzzer/FuzzerLoop.cpp:865:28  28: _ZN6fuzzer12FuzzerDriverEPiPPPcPFiPKhmE             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/libfuzzer/FuzzerDriver.cpp:912:10  29: main             at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libfuzzer-sys-0.4.6/libfuzzer/FuzzerMain.cpp:20:30  30: <unknown>  31: __libc_start_main  32: _startnote: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.==4037== ERROR: libFuzzer: deadly signalNOTE: libFuzzer has rudimentary signal handlers.      Combine libFuzzer with AddressSanitizer or similar for better crash reports.SUMMARY: libFuzzer: deadly signalMS: 0 ; base unit: 0000000000000000000000000000000000000000artifact_prefix='/home/runner/work/qsharp/qsharp/fuzz/artifacts/compile/'; Test unit written to /home/runner/work/qsharp/qsharp/fuzz/artifacts/compile/crash-8e96b8cf7935380fe73350786525aace3c6965f3────────────────────────────────────────────────────────────────────────────────Failing input:	fuzz/artifacts/compile/crash-8e96b8cf7935380fe73350786525aace3c6965f3Output of `std::fmt::Debug`:	[47, 47, 32, 67, 111, 112, 121, 114, 105, 103, 104, 116, 32, 40, 99, 41, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 67, 111, 114, 112, 111, 114, 97, 116, 105, 111, 110, 46, 10, 47, 47, 32, 76, 105, 99, 101, 110, 115, 101, 100, 32, 117, 110, 100, 101, 114, 32, 116, 104, 101, 32, 77, 73, 84, 32, 76, 105, 99, 101, 110, 115, 101, 46, 10, 10, 110, 97, 109, 101, 115, 112, 97, 99, 101, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 81, 117, 97, 110, 116, 117, 109, 46, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 115, 32, 123, 32, 32, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 83, 117, 109, 109, 97, 114, 121, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 115, 115, 101, 114, 116, 115, 32, 116, 104, 97, 116, 32, 109, 101, 97, 115, 117, 114, 105, 110, 103, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 113, 117, 98, 105, 116, 115, 32, 105, 110, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 80, 97, 117, 108, 105, 32, 98, 97, 115, 105, 115, 32, 119, 105, 108, 108, 10, 32, 32, 32, 32, 47, 47, 47, 32, 97, 108, 119, 97, 121, 115, 32, 104, 97, 118, 101, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 114, 101, 115, 117, 108, 116, 46, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 73, 110, 112, 117, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 98, 97, 115, 101, 115, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 32, 109, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 32, 101, 102, 102, 101, 99, 116, 32, 116, 111, 32, 97, 115, 115, 101, 114, 116, 32, 116, 104, 101, 32, 112, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 32, 111, 102, 44, 32, 101, 120, 112, 114, 101, 115, 115, 101, 100, 32, 97, 115, 32, 97, 10, 32, 32, 32, 32, 47, 47, 47, 32, 109, 117, 108, 116, 105, 45, 113, 117, 98, 105, 116, 32, 80, 97, 117, 108, 105, 32, 111, 112, 101, 114, 97, 116, 111, 114, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 113, 117, 98, 105, 116, 115, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 32, 114, 101, 103, 105, 115, 116, 101, 114, 32, 111, 110, 32, 119, 104, 105, 99, 104, 32, 116, 111, 32, 109, 97, 107, 101, 32, 116, 104, 101, 32, 97, 115, 115, 101, 114, 116, 105, 111, 110, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 114, 101, 115, 117, 108, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 84, 104, 101, 32, 101, 120, 112, 101, 99, 116, 101, 100, 32, 114, 101, 115, 117, 108, 116, 32, 111, 102, 32, 96, 77, 101, 97, 115, 117, 114, 101, 40, 98, 97, 115, 101, 115, 44, 32, 113, 117, 98, 105, 116, 115, 41, 96, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 109, 115, 103, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 32, 109, 101, 115, 115, 97, 103, 101, 32, 116, 111, 32, 98, 101, 32, 114, 101, 112, 111, 114, 116, 101, 100, 32, 105, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 115, 46, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 82, 101, 109, 97, 114, 107, 115, 10, 32, 32, 32, 32, 47, 47, 47, 32, 78, 111, 116, 101, 32, 116, 104, 97, 116, 32, 116, 104, 101, 32, 65, 100, 106, 111, 105, 110, 116, 32, 97, 110, 100, 32, 67, 111, 110, 116, 114, 111, 108, 108, 101, 100, 32, 118, 101, 114, 115, 105, 111, 110, 115, 32, 111, 102, 32, 116, 104, 105, 115, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 119, 105, 108, 108, 32, 110, 111, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 99, 104, 101, 99, 107, 32, 116, 104, 101, 32, 99, 111, 110, 100, 105, 116, 105, 111, 110, 46, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 83, 101, 101, 32, 65, 108, 115, 111, 10, 32, 32, 32, 32, 47, 47, 47, 32, 45, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 81, 117, 97, 110, 116, 117, 109, 46, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 115, 46, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 80, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 10, 32, 32, 32, 32, 47, 47, 47, 32, 45, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 81, 117, 97, 110, 116, 117, 109, 46, 73, 110, 116, 114, 105, 110, 115, 105, 99, 46, 77, 101, 97, 115, 117, 114, 101, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 69, 120, 97, 109, 112, 108, 101, 10, 32, 32, 32, 32, 47, 47, 47, 32, 84, 104, 101, 32, 102, 111, 108, 108, 111, 119, 105, 110, 103, 32, 115, 110, 105, 112, 112, 101, 116, 32, 119, 105, 108, 108, 32, 101, 120, 101, 99, 117, 116, 101, 32, 119, 105, 116, 104, 111, 117, 116, 32, 101, 114, 114, 111, 114, 115, 32, 111, 110, 32, 116, 104, 101, 32, 102, 117, 108, 108, 45, 115, 116, 97, 116, 101, 10, 32, 32, 32, 32, 47, 47, 47, 32, 115, 105, 109, 117, 108, 97, 116, 111, 114, 58, 10, 32, 32, 32, 32, 47, 47, 47, 32, 96, 96, 96, 113, 115, 104, 97, 114, 112, 10, 32, 32, 32, 32, 47, 47, 47, 32, 117, 115, 101, 32, 113, 32, 61, 32, 81, 117, 98, 105, 116, 40, 41, 59, 10, 32, 32, 32, 32, 47, 47, 47, 32, 119, 105, 116, 104, 105, 110, 32, 123, 10, 32, 32, 32, 32, 47, 47, 47, 32, 32, 32, 32, 32, 72, 40, 113, 41, 59, 10, 32, 32, 32, 32, 47, 47, 47, 32, 125, 32, 97, 112, 112, 108, 121, 32, 123, 10, 32, 32, 32, 32, 47, 47, 47, 32, 32, 32, 32, 32, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 40, 91, 80, 97, 117, 108, 105, 88, 93, 44, 32, 91, 113, 93, 44, 32, 90, 101, 114, 111, 44, 32, 34, 69, 120, 112, 101, 99, 116, 101, 100, 32, 124, 43, 226, 159, 169, 32, 115, 116, 97, 116, 101, 46, 34, 41, 59, 10, 32, 32, 32, 32, 47, 47, 47, 32, 125, 10, 32, 32, 32, 32, 47, 47, 47, 32, 96, 96, 96, 10, 32, 32, 32, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 40, 98, 97, 115, 101, 115, 32, 58, 32, 80, 97, 117, 108, 105, 91, 93, 44, 32, 113, 117, 98, 105, 116, 115, 32, 58, 32, 81, 117, 98, 105, 116, 91, 93, 44, 32, 114, 101, 115, 117, 108, 116, 32, 58, 32, 82, 101, 115, 117, 108, 116, 44, 32, 109, 115, 103, 32, 58, 32, 83, 116, 114, 105, 110, 103, 41, 32, 58, 32, 85, 110, 105, 116, 10, 32, 32, 32, 32, 105, 115, 32, 65, 100, 106, 32, 43, 32, 67, 116, 108, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 111, 100, 121, 32, 40, 46, 46, 46, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 80, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 40, 98, 97, 115, 101, 115, 44, 32, 113, 117, 98, 105, 116, 115, 44, 32, 114, 101, 115, 117, 108, 116, 44, 32, 49, 46, 48, 44, 32, 109, 115, 103, 44, 32, 49, 101, 45, 49, 48, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 125, 10, 32, 32, 32, 32, 32, 32, 32, 32, 97, 100, 106, 111, 105, 110, 116, 32, 115, 101, 108, 102, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99, 111, 110, 116, 114, 111, 108, 108, 101, 100, 32, 40, 99, 111, 110, 116, 114, 111, 108, 108, 105, 110, 103, 81, 117, 98, 105, 116, 115, 44, 32, 46, 46, 46, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 47, 32, 69, 109, 112, 116, 121, 46, 10, 32, 32, 32, 32, 32, 32, 32, 32, 125, 10, 32, 32, 32, 32, 125, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 83, 117, 109, 109, 97, 114, 121, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 115, 115, 101, 114, 116, 115, 32, 116, 104, 97, 116, 32, 109, 101, 97, 115, 117, 114, 105, 110, 103, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 113, 117, 98, 105, 116, 115, 32, 105, 110, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 80, 97, 117, 108, 105, 32, 98, 97, 115, 105, 115, 32, 119, 105, 108, 108, 32, 104, 97, 118, 101, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 114, 101, 115, 117, 108, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 112, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 44, 32, 119, 105, 116, 104, 105, 110, 32, 115, 111, 109, 101, 32, 116, 111, 108, 101, 114, 97, 110, 99, 101, 46, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 73, 110, 112, 117, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 98, 97, 115, 101, 115, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 32, 109, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 32, 101, 102, 102, 101, 99, 116, 32, 116, 111, 32, 97, 115, 115, 101, 114, 116, 32, 116, 104, 101, 32, 112, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 32, 111, 102, 44, 32, 101, 120, 112, 114, 101, 115, 115, 101, 100, 32, 97, 115, 32, 97, 10, 32, 32, 32, 32, 47, 47, 47, 32, 109, 117, 108, 116, 105, 45, 113, 117, 98, 105, 116, 32, 80, 97, 117, 108, 105, 32, 111, 112, 101, 114, 97, 116, 111, 114, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 113, 117, 98, 105, 116, 115, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 32, 114, 101, 103, 105, 115, 116, 101, 114, 32, 111, 110, 32, 119, 104, 105, 99, 104, 32, 116, 111, 32, 109, 97, 107, 101, 32, 116, 104, 101, 32, 97, 115, 115, 101, 114, 116, 105, 111, 110, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 114, 101, 115, 117, 108, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 110, 32, 101, 120, 112, 101, 99, 116, 101, 100, 32, 114, 101, 115, 117, 108, 116, 32, 111, 102, 32, 96, 77, 101, 97, 115, 117, 114, 101, 40, 98, 97, 115, 101, 115, 44, 32, 113, 117, 98, 105, 116, 115, 41, 96, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 112, 114, 111, 98, 10, 32, 32, 32, 32, 47, 47, 47, 32, 84, 104, 101, 32, 112, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 32, 119, 105, 116, 104, 32, 119, 104, 105, 99, 104, 32, 116, 104, 101, 32, 103, 105, 118, 101, 110, 32, 114, 101, 115, 117, 108, 116, 32, 105, 115, 32, 101, 120, 112, 101, 99, 116, 101, 100, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 109, 115, 103, 10, 32, 32, 32, 32, 47, 47, 47, 32, 65, 32, 109, 101, 115, 115, 97, 103, 101, 32, 116, 111, 32, 98, 101, 32, 114, 101, 112, 111, 114, 116, 101, 100, 32, 105, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 115, 46, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 35, 32, 116, 111, 108, 101, 114, 97, 110, 99, 101, 10, 32, 32, 32, 32, 47, 47, 47, 32, 84, 111, 108, 101, 114, 97, 110, 99, 101, 32, 97, 108, 108, 111, 119, 101, 100, 32, 105, 110, 32, 116, 104, 101, 32, 109, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 32, 112, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 46, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 69, 120, 97, 109, 112, 108, 101, 10, 32, 32, 32, 32, 47, 47, 47, 32, 96, 96, 96, 113, 115, 104, 97, 114, 112, 10, 32, 32, 32, 32, 47, 47, 47, 32, 117, 115, 105, 110, 103, 32, 40, 114, 101, 103, 105, 115, 116, 101, 114, 32, 61, 32, 81, 117, 98, 105, 116, 40, 41, 41, 32, 123, 10, 32, 32, 32, 32, 47, 47, 47, 32, 32, 32, 32, 32, 72, 40, 114, 101, 103, 105, 115, 116, 101, 114, 41, 59, 10, 32, 32, 32, 32, 47, 47, 47, 32, 32, 32, 32, 32, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 80, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 40, 91, 80, 97, 117, 108, 105, 90, 93, 44, 32, 91, 114, 101, 103, 105, 115, 116, 101, 114, 93, 44, 32, 79, 110, 101, 44, 32, 48, 46, 53, 44, 10, 32, 32, 32, 32, 47, 47, 47, 32, 32, 32, 32, 32, 32, 32, 32, 32, 34, 77, 101, 97, 115, 117, 114, 105, 110, 103, 32, 105, 110, 32, 99, 111, 110, 106, 117, 103, 97, 116, 101, 32, 98, 97, 115, 105, 115, 32, 100, 105, 100, 32, 110, 111, 116, 32, 103, 105, 118, 101, 32, 53, 48, 47, 53, 48, 32, 114, 101, 115, 117, 108, 116, 115, 46, 34, 44, 32, 49, 101, 45, 53, 41, 59, 10, 32, 32, 32, 32, 47, 47, 47, 32, 125, 10, 32, 32, 32, 32, 47, 47, 47, 32, 96, 96, 96, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 82, 101, 109, 97, 114, 107, 115, 10, 32, 32, 32, 32, 47, 47, 47, 32, 78, 111, 116, 101, 32, 116, 104, 97, 116, 32, 116, 104, 101, 32, 65, 100, 106, 111, 105, 110, 116, 32, 97, 110, 100, 32, 67, 111, 110, 116, 114, 111, 108, 108, 101, 100, 32, 118, 101, 114, 115, 105, 111, 110, 115, 32, 111, 102, 32, 116, 104, 105, 115, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 119, 105, 108, 108, 32, 110, 111, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 99, 104, 101, 99, 107, 32, 116, 104, 101, 32, 99, 111, 110, 100, 105, 116, 105, 111, 110, 46, 10, 32, 32, 32, 32, 47, 47, 47, 10, 32, 32, 32, 32, 47, 47, 47, 32, 35, 32, 83, 101, 101, 32, 65, 108, 115, 111, 10, 32, 32, 32, 32, 47, 47, 47, 32, 45, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 81, 117, 97, 110, 116, 117, 109, 46, 68, 105, 97, 103, 110, 111, 115, 116, 105, 99, 115, 46, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 10, 32, 32, 32, 32, 47, 47, 47, 32, 45, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 81, 117, 97, 110, 116, 117, 109, 46, 73, 110, 116, 114, 105, 110, 115, 105, 99, 46, 77, 101, 97, 115, 117, 114, 101, 10, 32, 32, 32, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 65, 115, 115, 101, 114, 116, 77, 101, 97, 115, 117, 114, 101, 109, 101, 110, 116, 80, 114, 111, 98, 97, 98, 105, 108, 105, 116, 121, 40, 98, 97, 115, 101, 115, 32, 58, 32, 80, 97, 117, 108, 105, 91, 93, 44, 32, 113, 117, 98, 105, 116, 115, 32, 58, 32, 81, 117, 98, 105, 116, 91, 93, 44, 32, 114, 101, 115, 117, 108, 116, 32, 58, 32, 82, 101, 115, 117, 108, 116, 44, 32, 112, 114, 111, 98, 32, 58, 32, 68, 111, 117, 98, 108, 101, 44, 32, 109, 115, 103, 32, 58, 32, 83, 116, 114, 105, 110, 103, 44, 32, 116, 111, 108, 101, 114, 97, 110, 99, 101, 32, 58, 32, 68, 111, 117, 98, 108, 101, 41, 32, 58, 32, 85, 110, 105, 116, 10, 32, 32, 32, 32, 105, 115, 32, 65, 100, 106, 32, 43, 32, 67, 116, 108, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 111, 100, 121, 32, 105, 110, 116, 114, 105, 110, 115, 105, 99, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 97, 100, 106, 111, 105, 110, 116, 32, 115, 101, 108, 102, 59, 10, 32, 32, 32, 32, 125, 10, 10, 125, 10]Reproduce with:	cargo fuzz run -O --features=do_fuzz --sanitizer=none compile fuzz/artifacts/compile/crash-8e96b8cf7935380fe73350786525aace3c6965f3Minimize test case with:	cargo fuzz tmin -O --features=do_fuzz --sanitizer=none compile fuzz/artifacts/compile/crash-8e96b8cf7935380fe73350786525aace3c6965f3────────────────────────────────────────────────────────────────────────────────Error: Fuzz target exited with exit status: 77Stack backtrace:   0: anyhow::error::<impl anyhow::Error>::msg   1: cargo_fuzz::project::FuzzProject::exec_fuzz   2: <cargo_fuzz::options::run::Run as cargo_fuzz::RunCommand>::run_command   3: cargo_fuzz::main   4: std::sys_common::backtrace::__rust_begin_short_backtrace   5: std::rt::lang_start::{{closure}}   6: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/core/src/ops/function.rs:284:13   7: std::panicking::try::do_call             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:524:40   8: std::panicking::try             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:488:19   9: std::panic::catch_unwind             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panic.rs:142:14  10: std::rt::lang_start_internal::{{closure}}             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/rt.rs:148:48  11: std::panicking::try::do_call             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:524:40  12: std::panicking::try             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panicking.rs:488:19  13: std::panic::catch_unwind             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/panic.rs:142:14  14: std::rt::lang_start_internal             at /rustc/864bdf7843e1ceabc824ed86d97006acad6af643/library/std/src/rt.rs:148:20  15: main  16: <unknown>  17: __libc_start_main  18: _start
```

</details>

<details><summary><b>The commit in <code>main</code> the bug has been found in:</b> Click.</summary>
If the developers fail to repro the bug in the latest <code>main</code> then the commit info below can help them to make sure
that they are using the correct way to repro. If the bug is reproducible in the commit below, but not in latest <code>main</code>,
then the bug is likely fixed already.

```log
commit 5c010e21a1bb8c2b55955f2a1cb13ced3355897fAuthor: Stefan J. Wernli <swernli@microsoft.com>Date:   Wed Jul 26 16:04:58 2023 -0700    Update Fuzz workflow to run on some merges to main (#498)
```

</details>

**Other Info**

- [**Workflow**](https://github.com/microsoft/qsharp/actions/runs/5674547995) (contains the run artifacts).
- **Workflow Agent System Info:** `ubuntu-latest: Linux fv-az357-805 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux`.
- **Bug Reporting Timestamp:** 2023.07.26 23:08 UTC (UTC - 8:00 = PST. UTC - 7:00 = PDT).



Discussion:

Patch:
diff --git a/compiler/qsc_passes/src/spec_gen.rs b/compiler/qsc_passes/src/spec_gen.rs
index 6d159229c3..e4d4bc9406 100644
--- a/compiler/qsc_passes/src/spec_gen.rs
+++ b/compiler/qsc_passes/src/spec_gen.rs
@@ -113,7 +113,7 @@ impl MutVisitor for SpecPlacePass<'_> {
                 SpecGen::Distribute
             };
             decl.ctl_adj = Some(SpecDecl {
-                id: NodeId::default(),
+                id: self.assigner.next_node(),
                 span: decl.span,
                 body: SpecBody::Gen(gen),
             });


Test patch:
diff --git a/compiler/qsc_passes/src/spec_gen/tests.rs b/compiler/qsc_passes/src/spec_gen/tests.rs
index bee7293451..3c618ac857 100644
--- a/compiler/qsc_passes/src/spec_gen/tests.rs
+++ b/compiler/qsc_passes/src/spec_gen/tests.rs
@@ -30,7 +30,7 @@ fn generate_specs_body_intrinsic_should_fail() {
     check(
         indoc! {"
         namespace test {
-            operation A(q : Qubit) : Unit is Ctl {
+            operation A(q : Qubit) : Unit is Adj + Ctl {
                 body intrinsic;
             }
         }
@@ -39,8 +39,8 @@ fn generate_specs_body_intrinsic_should_fail() {
             [
                 MissingBody(
                     Span {
-                        lo: 68,
-                        hi: 83,
+                        lo: 74,
+                        hi: 89,
                     },
                 ),
             ]
@@ -205,9 +205,9 @@ fn generate_ctladj_distrib() {
                         ctl: SpecDecl 8 [117-142]: Impl:
                             Pat 9 [129-133] [Type (Qubit)[]]: Bind: Ident 10 [129-133] "ctls"
                             Block 11 [140-142]: <empty>
-                        ctl-adj: SpecDecl 32 [21-148]: Impl:
-                            Pat 33 [21-148] [Type (Qubit)[]]: Bind: Ident 34 [21-148] "ctls"
-                            Block 35 [106-108]: <empty>
+                        ctl-adj: SpecDecl 34 [21-148]: Impl:
+                            Pat 35 [21-148] [Type (Qubit)[]]: Bind: Ident 36 [21-148] "ctls"
+                            Block 37 [106-108]: <empty>
                 Item 2 [153-308] (Public):
                     Parent: 0
                     Callable 12 [153-308] (operation):
@@ -226,25 +226,25 @@ fn generate_ctladj_distrib() {
                                     Expr 26 [279-288] [Type (Qubit => Unit is Adj + Ctl)]: UnOp (Functor Adj):
                                         Expr 27 [287-288] [Type (Qubit => Unit is Adj + Ctl)]: Var: Item 1
                                     Expr 28 [289-290] [Type Qubit]: Var: Local 15
-                        ctl: SpecDecl 37 [153-308]: Impl:
-                            Pat 38 [153-308] [Type (Qubit)[]]: Bind: Ident 39 [153-308] "ctls"
-                            Block 40 [215-244] [Type Unit]:
-                                Stmt 41 [229-234]: Semi: Expr 42 [229-233] [Type Unit]: Call:
-                                    Expr 43 [229-230] [Type (((Qubit)[], Qubit) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 44 [229-230] [Type (Qubit => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 45 [231-232] [Type ((Qubit)[], Qubit)]: Tuple:
-                                        Expr 46 [231-232] [Type (Qubit)[]]: Var: Local 39
-                                        Expr 47 [231-232] [Type Qubit]: Var: Local 15
-                        ctl-adj: SpecDecl 49 [153-308]: Impl:
-                            Pat 50 [153-308] [Type (Qubit)[]]: Bind: Ident 51 [153-308] "ctls"
-                            Block 52 [265-302] [Type Unit]:
-                                Stmt 53 [279-292]: Semi: Expr 54 [279-291] [Type Unit]: Call:
-                                    Expr 55 [279-288] [Type (((Qubit)[], Qubit) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 56 [279-288] [Type (Qubit => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                            Expr 57 [287-288] [Type (Qubit => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 58 [289-290] [Type ((Qubit)[], Qubit)]: Tuple:
-                                        Expr 59 [289-290] [Type (Qubit)[]]: Var: Local 51
-                                        Expr 60 [289-290] [Type Qubit]: Var: Local 15"#]],
+                        ctl: SpecDecl 39 [153-308]: Impl:
+                            Pat 40 [153-308] [Type (Qubit)[]]: Bind: Ident 41 [153-308] "ctls"
+                            Block 42 [215-244] [Type Unit]:
+                                Stmt 43 [229-234]: Semi: Expr 44 [229-233] [Type Unit]: Call:
+                                    Expr 45 [229-230] [Type (((Qubit)[], Qubit) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 46 [229-230] [Type (Qubit => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 47 [231-232] [Type ((Qubit)[], Qubit)]: Tuple:
+                                        Expr 48 [231-232] [Type (Qubit)[]]: Var: Local 41
+                                        Expr 49 [231-232] [Type Qubit]: Var: Local 15
+                        ctl-adj: SpecDecl 51 [153-308]: Impl:
+                            Pat 52 [153-308] [Type (Qubit)[]]: Bind: Ident 53 [153-308] "ctls"
+                            Block 54 [265-302] [Type Unit]:
+                                Stmt 55 [279-292]: Semi: Expr 56 [279-291] [Type Unit]: Call:
+                                    Expr 57 [279-288] [Type (((Qubit)[], Qubit) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 58 [279-288] [Type (Qubit => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                            Expr 59 [287-288] [Type (Qubit => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 60 [289-290] [Type ((Qubit)[], Qubit)]: Tuple:
+                                        Expr 61 [289-290] [Type (Qubit)[]]: Var: Local 53
+                                        Expr 62 [289-290] [Type Qubit]: Var: Local 15"#]],
     );
 }
 
@@ -507,14 +507,14 @@ fn generate_ctladj_self() {
                         functors: Adj + Ctl
                         body: SpecDecl 4 [21-68]: Impl:
                             Block 5 [66-68]: <empty>
-                        adj: SpecDecl 30 [21-68]: Impl:
+                        adj: SpecDecl 32 [21-68]: Impl:
+                            Block 33 [66-68]: <empty>
+                        ctl: SpecDecl 28 [21-68]: Impl:
+                            Pat 29 [21-68] [Type (Qubit)[]]: Bind: Ident 30 [21-68] "ctls"
                             Block 31 [66-68]: <empty>
-                        ctl: SpecDecl 26 [21-68]: Impl:
-                            Pat 27 [21-68] [Type (Qubit)[]]: Bind: Ident 28 [21-68] "ctls"
-                            Block 29 [66-68]: <empty>
-                        ctl-adj: SpecDecl 33 [21-68]: Impl:
-                            Pat 34 [21-68] [Type (Qubit)[]]: Bind: Ident 35 [21-68] "ctls"
-                            Block 36 [66-68]: <empty>
+                        ctl-adj: SpecDecl 35 [21-68]: Impl:
+                            Pat 36 [21-68] [Type (Qubit)[]]: Bind: Ident 37 [21-68] "ctls"
+                            Block 38 [66-68]: <empty>
                 Item 2 [73-178] (Public):
                     Parent: 0
                     Callable 6 [73-178] (operation):
@@ -530,44 +530,44 @@ fn generate_ctladj_self() {
                                 Stmt 16 [143-148]: Semi: Expr 17 [143-147] [Type Unit]: Call:
                                     Expr 18 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
                                     Expr 19 [145-146] [Type Int]: Lit: Int(2)
-                        adj: SpecDecl 56 [159-172]: Impl:
-                            Block 57 [135-150] [Type Unit]:
-                                Stmt 58 [137-142]: Semi: Expr 59 [137-141] [Type Unit]: Call:
-                                    Expr 60 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 61 [139-140] [Type Int]: Lit: Int(1)
-                                Stmt 62 [143-148]: Semi: Expr 63 [143-147] [Type Unit]: Call:
-                                    Expr 64 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 65 [145-146] [Type Int]: Lit: Int(2)
-                        ctl: SpecDecl 38 [73-178]: Impl:
-                            Pat 39 [73-178] [Type (Qubit)[]]: Bind: Ident 40 [73-178] "ctls"
-                            Block 41 [135-150] [Type Unit]:
-                                Stmt 42 [137-142]: Semi: Expr 43 [137-141] [Type Unit]: Call:
-                                    Expr 44 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 45 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 46 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 47 [139-140] [Type (Qubit)[]]: Var: Local 40
-                                        Expr 48 [139-140] [Type Int]: Lit: Int(1)
-                                Stmt 49 [143-148]: Semi: Expr 50 [143-147] [Type Unit]: Call:
-                                    Expr 51 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 52 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 53 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 54 [145-146] [Type (Qubit)[]]: Var: Local 40
-                                        Expr 55 [145-146] [Type Int]: Lit: Int(2)
-                        ctl-adj: SpecDecl 66 [73-178]: Impl:
-                            Pat 67 [73-178] [Type (Qubit)[]]: Bind: Ident 68 [73-178] "ctls"
-                            Block 69 [135-150] [Type Unit]:
-                                Stmt 70 [137-142]: Semi: Expr 71 [137-141] [Type Unit]: Call:
-                                    Expr 72 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 73 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 74 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 75 [139-140] [Type (Qubit)[]]: Var: Local 68
-                                        Expr 76 [139-140] [Type Int]: Lit: Int(1)
-                                Stmt 77 [143-148]: Semi: Expr 78 [143-147] [Type Unit]: Call:
-                                    Expr 79 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 80 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 81 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 82 [145-146] [Type (Qubit)[]]: Var: Local 68
-                                        Expr 83 [145-146] [Type Int]: Lit: Int(2)"#]],
+                        adj: SpecDecl 58 [159-172]: Impl:
+                            Block 59 [135-150] [Type Unit]:
+                                Stmt 60 [137-142]: Semi: Expr 61 [137-141] [Type Unit]: Call:
+                                    Expr 62 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 63 [139-140] [Type Int]: Lit: Int(1)
+                                Stmt 64 [143-148]: Semi: Expr 65 [143-147] [Type Unit]: Call:
+                                    Expr 66 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 67 [145-146] [Type Int]: Lit: Int(2)
+                        ctl: SpecDecl 40 [73-178]: Impl:
+                            Pat 41 [73-178] [Type (Qubit)[]]: Bind: Ident 42 [73-178] "ctls"
+                            Block 43 [135-150] [Type Unit]:
+                                Stmt 44 [137-142]: Semi: Expr 45 [137-141] [Type Unit]: Call:
+                                    Expr 46 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 47 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 48 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 49 [139-140] [Type (Qubit)[]]: Var: Local 42
+                                        Expr 50 [139-140] [Type Int]: Lit: Int(1)
+                                Stmt 51 [143-148]: Semi: Expr 52 [143-147] [Type Unit]: Call:
+                                    Expr 53 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 54 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 55 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 56 [145-146] [Type (Qubit)[]]: Var: Local 42
+                                        Expr 57 [145-146] [Type Int]: Lit: Int(2)
+                        ctl-adj: SpecDecl 68 [73-178]: Impl:
+                            Pat 69 [73-178] [Type (Qubit)[]]: Bind: Ident 70 [73-178] "ctls"
+                            Block 71 [135-150] [Type Unit]:
+                                Stmt 72 [137-142]: Semi: Expr 73 [137-141] [Type Unit]: Call:
+                                    Expr 74 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 75 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 76 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 77 [139-140] [Type (Qubit)[]]: Var: Local 70
+                                        Expr 78 [139-140] [Type Int]: Lit: Int(1)
+                                Stmt 79 [143-148]: Semi: Expr 80 [143-147] [Type Unit]: Call:
+                                    Expr 81 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 82 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 83 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 84 [145-146] [Type (Qubit)[]]: Var: Local 70
+                                        Expr 85 [145-146] [Type Int]: Lit: Int(2)"#]],
     );
 }
 
@@ -1277,14 +1277,14 @@ fn generate_ctladj_distribute() {
                         functors: Adj + Ctl
                         body: SpecDecl 4 [21-68]: Impl:
                             Block 5 [66-68]: <empty>
-                        adj: SpecDecl 30 [21-68]: Impl:
+                        adj: SpecDecl 32 [21-68]: Impl:
+                            Block 33 [66-68]: <empty>
+                        ctl: SpecDecl 28 [21-68]: Impl:
+                            Pat 29 [21-68] [Type (Qubit)[]]: Bind: Ident 30 [21-68] "ctls"
                             Block 31 [66-68]: <empty>
-                        ctl: SpecDecl 26 [21-68]: Impl:
-                            Pat 27 [21-68] [Type (Qubit)[]]: Bind: Ident 28 [21-68] "ctls"
-                            Block 29 [66-68]: <empty>
-                        ctl-adj: SpecDecl 33 [21-68]: Impl:
-                            Pat 34 [21-68] [Type (Qubit)[]]: Bind: Ident 35 [21-68] "ctls"
-                            Block 36 [66-68]: <empty>
+                        ctl-adj: SpecDecl 35 [21-68]: Impl:
+                            Pat 36 [21-68] [Type (Qubit)[]]: Bind: Ident 37 [21-68] "ctls"
+                            Block 38 [66-68]: <empty>
                 Item 2 [73-156] (Public):
                     Parent: 0
                     Callable 6 [73-156] (operation):
@@ -1300,48 +1300,48 @@ fn generate_ctladj_distribute() {
                                 Stmt 16 [143-148]: Semi: Expr 17 [143-147] [Type Unit]: Call:
                                     Expr 18 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
                                     Expr 19 [145-146] [Type Int]: Lit: Int(2)
-                        adj: SpecDecl 56 [73-156]: Impl:
-                            Block 57 [135-150] [Type Unit]:
-                                Stmt 58 [143-148]: Semi: Expr 59 [143-147] [Type Unit]: Call:
-                                    Expr 60 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 61 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 62 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 63 [137-142]: Semi: Expr 64 [137-141] [Type Unit]: Call:
-                                    Expr 65 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 66 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 67 [139-140] [Type Int]: Lit: Int(1)
-                        ctl: SpecDecl 38 [73-156]: Impl:
-                            Pat 39 [73-156] [Type (Qubit)[]]: Bind: Ident 40 [73-156] "ctls"
-                            Block 41 [135-150] [Type Unit]:
-                                Stmt 42 [137-142]: Semi: Expr 43 [137-141] [Type Unit]: Call:
-                                    Expr 44 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 45 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 46 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 47 [139-140] [Type (Qubit)[]]: Var: Local 40
-                                        Expr 48 [139-140] [Type Int]: Lit: Int(1)
-                                Stmt 49 [143-148]: Semi: Expr 50 [143-147] [Type Unit]: Call:
-                                    Expr 51 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 52 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 53 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 54 [145-146] [Type (Qubit)[]]: Var: Local 40
-                                        Expr 55 [145-146] [Type Int]: Lit: Int(2)
-                        ctl-adj: SpecDecl 69 [73-156]: Impl:
-                            Pat 70 [73-156] [Type (Qubit)[]]: Bind: Ident 71 [73-156] "ctls"
-                            Block 72 [135-150] [Type Unit]:
-                                Stmt 73 [143-148]: Semi: Expr 74 [143-147] [Type Unit]: Call:
-                                    Expr 75 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 76 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                            Expr 77 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 78 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 79 [145-146] [Type (Qubit)[]]: Var: Local 71
-                                        Expr 80 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 81 [137-142]: Semi: Expr 82 [137-141] [Type Unit]: Call:
-                                    Expr 83 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 84 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                            Expr 85 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 86 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 87 [139-140] [Type (Qubit)[]]: Var: Local 71
-                                        Expr 88 [139-140] [Type Int]: Lit: Int(1)"#]],
+                        adj: SpecDecl 58 [73-156]: Impl:
+                            Block 59 [135-150] [Type Unit]:
+                                Stmt 60 [143-148]: Semi: Expr 61 [143-147] [Type Unit]: Call:
+                                    Expr 62 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 63 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 64 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 65 [137-142]: Semi: Expr 66 [137-141] [Type Unit]: Call:
+                                    Expr 67 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 68 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 69 [139-140] [Type Int]: Lit: Int(1)
+                        ctl: SpecDecl 40 [73-156]: Impl:
+                            Pat 41 [73-156] [Type (Qubit)[]]: Bind: Ident 42 [73-156] "ctls"
+                            Block 43 [135-150] [Type Unit]:
+                                Stmt 44 [137-142]: Semi: Expr 45 [137-141] [Type Unit]: Call:
+                                    Expr 46 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 47 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 48 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 49 [139-140] [Type (Qubit)[]]: Var: Local 42
+                                        Expr 50 [139-140] [Type Int]: Lit: Int(1)
+                                Stmt 51 [143-148]: Semi: Expr 52 [143-147] [Type Unit]: Call:
+                                    Expr 53 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 54 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 55 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 56 [145-146] [Type (Qubit)[]]: Var: Local 42
+                                        Expr 57 [145-146] [Type Int]: Lit: Int(2)
+                        ctl-adj: SpecDecl 71 [73-156]: Impl:
+                            Pat 72 [73-156] [Type (Qubit)[]]: Bind: Ident 73 [73-156] "ctls"
+                            Block 74 [135-150] [Type Unit]:
+                                Stmt 75 [143-148]: Semi: Expr 76 [143-147] [Type Unit]: Call:
+                                    Expr 77 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 78 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                            Expr 79 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 80 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 81 [145-146] [Type (Qubit)[]]: Var: Local 73
+                                        Expr 82 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 83 [137-142]: Semi: Expr 84 [137-141] [Type Unit]: Call:
+                                    Expr 85 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 86 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                            Expr 87 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 88 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 89 [139-140] [Type (Qubit)[]]: Var: Local 73
+                                        Expr 90 [139-140] [Type Int]: Lit: Int(1)"#]],
     );
 }
 
@@ -1370,14 +1370,14 @@ fn generate_ctladj_auto_to_distribute() {
                         functors: Adj + Ctl
                         body: SpecDecl 4 [21-68]: Impl:
                             Block 5 [66-68]: <empty>
-                        adj: SpecDecl 31 [21-68]: Impl:
+                        adj: SpecDecl 33 [21-68]: Impl:
+                            Block 34 [66-68]: <empty>
+                        ctl: SpecDecl 29 [21-68]: Impl:
+                            Pat 30 [21-68] [Type (Qubit)[]]: Bind: Ident 31 [21-68] "ctls"
                             Block 32 [66-68]: <empty>
-                        ctl: SpecDecl 27 [21-68]: Impl:
-                            Pat 28 [21-68] [Type (Qubit)[]]: Bind: Ident 29 [21-68] "ctls"
-                            Block 30 [66-68]: <empty>
-                        ctl-adj: SpecDecl 34 [21-68]: Impl:
-                            Pat 35 [21-68] [Type (Qubit)[]]: Bind: Ident 36 [21-68] "ctls"
-                            Block 37 [66-68]: <empty>
+                        ctl-adj: SpecDecl 36 [21-68]: Impl:
+                            Pat 37 [21-68] [Type (Qubit)[]]: Bind: Ident 38 [21-68] "ctls"
+                            Block 39 [66-68]: <empty>
                 Item 2 [73-189] (Public):
                     Parent: 0
                     Callable 6 [73-189] (operation):
@@ -1393,48 +1393,48 @@ fn generate_ctladj_auto_to_distribute() {
                                 Stmt 16 [143-148]: Semi: Expr 17 [143-147] [Type Unit]: Call:
                                     Expr 18 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
                                     Expr 19 [145-146] [Type Int]: Lit: Int(2)
-                        adj: SpecDecl 57 [73-189]: Impl:
-                            Block 58 [135-150] [Type Unit]:
-                                Stmt 59 [143-148]: Semi: Expr 60 [143-147] [Type Unit]: Call:
-                                    Expr 61 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 62 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 63 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 64 [137-142]: Semi: Expr 65 [137-141] [Type Unit]: Call:
-                                    Expr 66 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 67 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 68 [139-140] [Type Int]: Lit: Int(1)
-                        ctl: SpecDecl 39 [73-189]: Impl:
-                            Pat 40 [73-189] [Type (Qubit)[]]: Bind: Ident 41 [73-189] "ctls"
-                            Block 42 [135-150] [Type Unit]:
-                                Stmt 43 [137-142]: Semi: Expr 44 [137-141] [Type Unit]: Call:
-                                    Expr 45 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 46 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 47 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 48 [139-140] [Type (Qubit)[]]: Var: Local 41
-                                        Expr 49 [139-140] [Type Int]: Lit: Int(1)
-                                Stmt 50 [143-148]: Semi: Expr 51 [143-147] [Type Unit]: Call:
-                                    Expr 52 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 53 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 54 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 55 [145-146] [Type (Qubit)[]]: Var: Local 41
-                                        Expr 56 [145-146] [Type Int]: Lit: Int(2)
-                        ctl-adj: SpecDecl 70 [73-189]: Impl:
-                            Pat 71 [73-189] [Type (Qubit)[]]: Bind: Ident 72 [73-189] "ctls"
-                            Block 73 [135-150] [Type Unit]:
-                                Stmt 74 [143-148]: Semi: Expr 75 [143-147] [Type Unit]: Call:
-                                    Expr 76 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 77 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                            Expr 78 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 79 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 80 [145-146] [Type (Qubit)[]]: Var: Local 72
-                                        Expr 81 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 82 [137-142]: Semi: Expr 83 [137-141] [Type Unit]: Call:
-                                    Expr 84 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 85 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                            Expr 86 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 87 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 88 [139-140] [Type (Qubit)[]]: Var: Local 72
-                                        Expr 89 [139-140] [Type Int]: Lit: Int(1)"#]],
+                        adj: SpecDecl 59 [73-189]: Impl:
+                            Block 60 [135-150] [Type Unit]:
+                                Stmt 61 [143-148]: Semi: Expr 62 [143-147] [Type Unit]: Call:
+                                    Expr 63 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 64 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 65 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 66 [137-142]: Semi: Expr 67 [137-141] [Type Unit]: Call:
+                                    Expr 68 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 69 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 70 [139-140] [Type Int]: Lit: Int(1)
+                        ctl: SpecDecl 41 [73-189]: Impl:
+                            Pat 42 [73-189] [Type (Qubit)[]]: Bind: Ident 43 [73-189] "ctls"
+                            Block 44 [135-150] [Type Unit]:
+                                Stmt 45 [137-142]: Semi: Expr 46 [137-141] [Type Unit]: Call:
+                                    Expr 47 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 48 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 49 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 50 [139-140] [Type (Qubit)[]]: Var: Local 43
+                                        Expr 51 [139-140] [Type Int]: Lit: Int(1)
+                                Stmt 52 [143-148]: Semi: Expr 53 [143-147] [Type Unit]: Call:
+                                    Expr 54 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 55 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 56 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 57 [145-146] [Type (Qubit)[]]: Var: Local 43
+                                        Expr 58 [145-146] [Type Int]: Lit: Int(2)
+                        ctl-adj: SpecDecl 72 [73-189]: Impl:
+                            Pat 73 [73-189] [Type (Qubit)[]]: Bind: Ident 74 [73-189] "ctls"
+                            Block 75 [135-150] [Type Unit]:
+                                Stmt 76 [143-148]: Semi: Expr 77 [143-147] [Type Unit]: Call:
+                                    Expr 78 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 79 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                            Expr 80 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 81 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 82 [145-146] [Type (Qubit)[]]: Var: Local 74
+                                        Expr 83 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 84 [137-142]: Semi: Expr 85 [137-141] [Type Unit]: Call:
+                                    Expr 86 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 87 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                            Expr 88 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 89 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 90 [139-140] [Type (Qubit)[]]: Var: Local 74
+                                        Expr 91 [139-140] [Type Int]: Lit: Int(1)"#]],
     );
 }
 
@@ -1464,14 +1464,14 @@ fn generate_ctladj_auto_to_invert() {
                         functors: Adj + Ctl
                         body: SpecDecl 4 [21-68]: Impl:
                             Block 5 [66-68]: <empty>
-                        adj: SpecDecl 48 [21-68]: Impl:
+                        adj: SpecDecl 50 [21-68]: Impl:
+                            Block 51 [66-68]: <empty>
+                        ctl: SpecDecl 46 [21-68]: Impl:
+                            Pat 47 [21-68] [Type (Qubit)[]]: Bind: Ident 48 [21-68] "ctls"
                             Block 49 [66-68]: <empty>
-                        ctl: SpecDecl 44 [21-68]: Impl:
-                            Pat 45 [21-68] [Type (Qubit)[]]: Bind: Ident 46 [21-68] "ctls"
-                            Block 47 [66-68]: <empty>
-                        ctl-adj: SpecDecl 51 [21-68]: Impl:
-                            Pat 52 [21-68] [Type (Qubit)[]]: Bind: Ident 53 [21-68] "ctls"
-                            Block 54 [66-68]: <empty>
+                        ctl-adj: SpecDecl 53 [21-68]: Impl:
+                            Pat 54 [21-68] [Type (Qubit)[]]: Bind: Ident 55 [21-68] "ctls"
+                            Block 56 [66-68]: <empty>
                 Item 2 [73-270] (Public):
                     Parent: 0
                     Callable 6 [73-270] (operation):
@@ -1487,16 +1487,16 @@ fn generate_ctladj_auto_to_invert() {
                                 Stmt 16 [143-148]: Semi: Expr 17 [143-147] [Type Unit]: Call:
                                     Expr 18 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
                                     Expr 19 [145-146] [Type Int]: Lit: Int(2)
-                        adj: SpecDecl 55 [73-270]: Impl:
-                            Block 56 [135-150] [Type Unit]:
-                                Stmt 57 [143-148]: Semi: Expr 58 [143-147] [Type Unit]: Call:
-                                    Expr 59 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 60 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 61 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 62 [137-142]: Semi: Expr 63 [137-141] [Type Unit]: Call:
-                                    Expr 64 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 65 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 66 [139-140] [Type Int]: Lit: Int(1)
+                        adj: SpecDecl 57 [73-270]: Impl:
+                            Block 58 [135-150] [Type Unit]:
+                                Stmt 59 [143-148]: Semi: Expr 60 [143-147] [Type Unit]: Call:
+                                    Expr 61 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 62 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 63 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 64 [137-142]: Semi: Expr 65 [137-141] [Type Unit]: Call:
+                                    Expr 66 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 67 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 68 [139-140] [Type Int]: Lit: Int(1)
                         ctl: SpecDecl 20 [159-231]: Impl:
                             Pat 21 [171-175] [Type (Qubit)[]]: Bind: Ident 22 [171-175] "ctls"
                             Block 23 [182-231] [Type Unit]:
@@ -1512,23 +1512,23 @@ fn generate_ctladj_auto_to_invert() {
                                     Expr 35 [219-228] [Type ((Qubit)[], Int)]: Tuple:
                                         Expr 36 [220-224] [Type (Qubit)[]]: Var: Local 22
                                         Expr 37 [226-227] [Type Int]: Lit: Int(2)
-                        ctl-adj: SpecDecl 67 [73-270]: Impl:
-                            Pat 68 [171-175] [Type (Qubit)[]]: Bind: Ident 69 [171-175] "ctls"
-                            Block 70 [182-231] [Type Unit]:
-                                Stmt 71 [207-229]: Semi: Expr 72 [207-228] [Type Unit]: Call:
-                                    Expr 73 [207-219] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 74 [207-219] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                            Expr 75 [218-219] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 76 [219-228] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 77 [220-224] [Type (Qubit)[]]: Var: Local 69
-                                        Expr 78 [226-227] [Type Int]: Lit: Int(2)
-                                Stmt 79 [184-206]: Semi: Expr 80 [184-205] [Type Unit]: Call:
-                                    Expr 81 [184-196] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 82 [184-196] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                            Expr 83 [195-196] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 84 [196-205] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 85 [197-201] [Type (Qubit)[]]: Var: Local 69
-                                        Expr 86 [203-204] [Type Int]: Lit: Int(1)"#]],
+                        ctl-adj: SpecDecl 69 [73-270]: Impl:
+                            Pat 70 [171-175] [Type (Qubit)[]]: Bind: Ident 71 [171-175] "ctls"
+                            Block 72 [182-231] [Type Unit]:
+                                Stmt 73 [207-229]: Semi: Expr 74 [207-228] [Type Unit]: Call:
+                                    Expr 75 [207-219] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 76 [207-219] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                            Expr 77 [218-219] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 78 [219-228] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 79 [220-224] [Type (Qubit)[]]: Var: Local 71
+                                        Expr 80 [226-227] [Type Int]: Lit: Int(2)
+                                Stmt 81 [184-206]: Semi: Expr 82 [184-205] [Type Unit]: Call:
+                                    Expr 83 [184-196] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 84 [184-196] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                            Expr 85 [195-196] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 86 [196-205] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 87 [197-201] [Type (Qubit)[]]: Var: Local 71
+                                        Expr 88 [203-204] [Type Int]: Lit: Int(1)"#]],
     );
 }
 
@@ -1557,14 +1557,14 @@ fn generate_ctladj_invert() {
                         functors: Adj + Ctl
                         body: SpecDecl 4 [21-68]: Impl:
                             Block 5 [66-68]: <empty>
-                        adj: SpecDecl 31 [21-68]: Impl:
-                            Block 32 [66-68]: <empty>
-                        ctl: SpecDecl 27 [21-68]: Impl:
-                            Pat 28 [21-68] [Type (Qubit)[]]: Bind: Ident 29 [21-68] "ctls"
-                            Block 30 [66-68]: <empty>
-                        ctl-adj: SpecDecl 34 [21-68]: Impl:
-                            Pat 35 [21-68] [Type (Qubit)[]]: Bind: Ident 36 [21-68] "ctls"
-                            Block 37 [66-68]: <empty>
+                        adj: SpecDecl 32 [21-68]: Impl:
+                            Block 33 [66-68]: <empty>
+                        ctl: SpecDecl 28 [21-68]: Impl:
+                            Pat 29 [21-68] [Type (Qubit)[]]: Bind: Ident 30 [21-68] "ctls"
+                            Block 31 [66-68]: <empty>
+                        ctl-adj: SpecDecl 35 [21-68]: Impl:
+                            Pat 36 [21-68] [Type (Qubit)[]]: Bind: Ident 37 [21-68] "ctls"
+                            Block 38 [66-68]: <empty>
                 Item 2 [73-191] (Public):
                     Parent: 0
                     Callable 6 [73-191] (operation):
@@ -1580,48 +1580,48 @@ fn generate_ctladj_invert() {
                                 Stmt 16 [143-148]: Semi: Expr 17 [143-147] [Type Unit]: Call:
                                     Expr 18 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
                                     Expr 19 [145-146] [Type Int]: Lit: Int(2)
-                        adj: SpecDecl 57 [73-191]: Impl:
-                            Block 58 [135-150] [Type Unit]:
-                                Stmt 59 [143-148]: Semi: Expr 60 [143-147] [Type Unit]: Call:
-                                    Expr 61 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 62 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 63 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 64 [137-142]: Semi: Expr 65 [137-141] [Type Unit]: Call:
-                                    Expr 66 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 67 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 68 [139-140] [Type Int]: Lit: Int(1)
-                        ctl: SpecDecl 39 [73-191]: Impl:
-                            Pat 40 [73-191] [Type (Qubit)[]]: Bind: Ident 41 [73-191] "ctls"
-                            Block 42 [135-150] [Type Unit]:
-                                Stmt 43 [137-142]: Semi: Expr 44 [137-141] [Type Unit]: Call:
-                                    Expr 45 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 46 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 47 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 48 [139-140] [Type (Qubit)[]]: Var: Local 41
-                                        Expr 49 [139-140] [Type Int]: Lit: Int(1)
-                                Stmt 50 [143-148]: Semi: Expr 51 [143-147] [Type Unit]: Call:
-                                    Expr 52 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                        Expr 53 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 54 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 55 [145-146] [Type (Qubit)[]]: Var: Local 41
-                                        Expr 56 [145-146] [Type Int]: Lit: Int(2)
-                        ctl-adj: SpecDecl 69 [159-185]: Impl:
-                            Pat 70 [73-191] [Type (Qubit)[]]: Bind: Ident 71 [73-191] "ctls"
-                            Block 72 [135-150] [Type Unit]:
-                                Stmt 73 [143-148]: Semi: Expr 74 [143-147] [Type Unit]: Call:
-                                    Expr 75 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 76 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                            Expr 77 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 78 [145-146] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 79 [145-146] [Type (Qubit)[]]: Var: Local 71
-                                        Expr 80 [145-146] [Type Int]: Lit: Int(2)
-                                Stmt 81 [137-142]: Semi: Expr 82 [137-141] [Type Unit]: Call:
-                                    Expr 83 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
-                                        Expr 84 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
-                                            Expr 85 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
-                                    Expr 86 [139-140] [Type ((Qubit)[], Int)]: Tuple:
-                                        Expr 87 [139-140] [Type (Qubit)[]]: Var: Local 71
-                                        Expr 88 [139-140] [Type Int]: Lit: Int(1)"#]],
+                        adj: SpecDecl 58 [73-191]: Impl:
+                            Block 59 [135-150] [Type Unit]:
+                                Stmt 60 [143-148]: Semi: Expr 61 [143-147] [Type Unit]: Call:
+                                    Expr 62 [143-144] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 63 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 64 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 65 [137-142]: Semi: Expr 66 [137-141] [Type Unit]: Call:
+                                    Expr 67 [137-138] [Type (Int => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 68 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 69 [139-140] [Type Int]: Lit: Int(1)
+                        ctl: SpecDecl 40 [73-191]: Impl:
+                            Pat 41 [73-191] [Type (Qubit)[]]: Bind: Ident 42 [73-191] "ctls"
+                            Block 43 [135-150] [Type Unit]:
+                                Stmt 44 [137-142]: Semi: Expr 45 [137-141] [Type Unit]: Call:
+                                    Expr 46 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 47 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 48 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 49 [139-140] [Type (Qubit)[]]: Var: Local 42
+                                        Expr 50 [139-140] [Type Int]: Lit: Int(1)
+                                Stmt 51 [143-148]: Semi: Expr 52 [143-147] [Type Unit]: Call:
+                                    Expr 53 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                        Expr 54 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 55 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 56 [145-146] [Type (Qubit)[]]: Var: Local 42
+                                        Expr 57 [145-146] [Type Int]: Lit: Int(2)
+                        ctl-adj: SpecDecl 70 [159-185]: Impl:
+                            Pat 71 [73-191] [Type (Qubit)[]]: Bind: Ident 72 [73-191] "ctls"
+                            Block 73 [135-150] [Type Unit]:
+                                Stmt 74 [143-148]: Semi: Expr 75 [143-147] [Type Unit]: Call:
+                                    Expr 76 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 77 [143-144] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                            Expr 78 [143-144] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 79 [145-146] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 80 [145-146] [Type (Qubit)[]]: Var: Local 72
+                                        Expr 81 [145-146] [Type Int]: Lit: Int(2)
+                                Stmt 82 [137-142]: Semi: Expr 83 [137-141] [Type Unit]: Call:
+                                    Expr 84 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Adj):
+                                        Expr 85 [137-138] [Type (((Qubit)[], Int) => Unit is Adj + Ctl)]: UnOp (Functor Ctl):
+                                            Expr 86 [137-138] [Type (Int => Unit is Adj + Ctl)]: Var: Item 1
+                                    Expr 87 [139-140] [Type ((Qubit)[], Int)]: Tuple:
+                                        Expr 88 [139-140] [Type (Qubit)[]]: Var: Local 72
+                                        Expr 89 [139-140] [Type Int]: Lit: Int(1)"#]],
     );
 }
 
@@ -1771,8 +1771,8 @@ fn op_array_forget_functors_with_lambdas() {
                         functors: Adj
                         body: SpecDecl 10 [92-131]: Impl:
                             Block 11 [129-131]: <empty>
-                        adj: SpecDecl 56 [92-131]: Impl:
-                            Block 57 [129-131]: <empty>
+                        adj: SpecDecl 57 [92-131]: Impl:
+                            Block 58 [129-131]: <empty>
                         ctl: <none>
                         ctl-adj: <none>
                 Item 3 [148-193] (Public):
@@ -1784,14 +1784,14 @@ fn op_array_forget_functors_with_lambdas() {
                         functors: Adj + Ctl
                         body: SpecDecl 16 [148-193]: Impl:
                             Block 17 [191-193]: <empty>
-                        adj: SpecDecl 63 [148-193]: Impl:
-                            Block 64 [191-193]: <empty>
-                        ctl: SpecDecl 59 [148-193]: Impl:
-                            Pat 60 [148-193] [Type (Qubit)[]]: Bind: Ident 61 [148-193] "ctls"
-                            Block 62 [191-193]: <empty>
-                        ctl-adj: SpecDecl 66 [148-193]: Impl:
-                            Pat 67 [148-193] [Type (Qubit)[]]: Bind: Ident 68 [148-193] "ctls"
-                            Block 69 [191-193]: <empty>
+                        adj: SpecDecl 64 [148-193]: Impl:
+                            Block 65 [191-193]: <empty>
+                        ctl: SpecDecl 60 [148-193]: Impl:
+                            Pat 61 [148-193] [Type (Qubit)[]]: Bind: Ident 62 [148-193] "ctls"
+                            Block 63 [191-193]: <empty>
+                        ctl-adj: SpecDecl 67 [148-193]: Impl:
+                            Pat 68 [148-193] [Type (Qubit)[]]: Bind: Ident 69 [148-193] "ctls"
+                            Block 70 [191-193]: <empty>
                 Item 4 [210-314] (Public):
                     Parent: 0
                     Callable 18 [210-314] (operation):