Skip to main content

W0001: Unnecessary disclose(...)

disclose(...) is only meaningful when its input is private and you need a public value.

If the wrapped expression is already public, disclose(...) is redundant and triggers W0001.

Why this warning exists​

Redundant disclose(...) wrappers add noise and hide where visibility boundaries actually occur.

How to fix​

Remove disclose(...) when the value is already public:

// before
counter = disclose(counter + 1); // `counter + 1` is already public

// after
counter = counter + 1;

Keep disclose(...) only where it converts private data to public data.