UNI012: Closure variable capture detected
What and why
Lambda or anonymous method captures outer scope variable (heap allocation).
Captured variables allocate display classes on the heap.
How to fix: hoist captures, use static lambdas where possible, or reduce scope.
Fix guidance
Reduce captured variables or hoist allocations outside hot paths.
Tags
performance, gc-pressure
Suppression
Use // unilyze-disable-next-line UNI012 -- reason immediately before the reported line.
These detector findings are line-based, so separate overload occurrences can be suppressed independently.
For project-wide suppression, use "rules": { "UNI012": "off" }; use a baseline to freeze existing findings while reporting new ones.