Minimal reproducible snippet:
contract Example(
a: Int,
b: Int
) {
const DEFAULT: Int = 42; // contract parameter mixed with constant
}
Actual behavior:
The compiler correctly accepts contracts declaring parameters alongside internal constants.
However, this valid combination is not mentioned in the documentation.
Expected behavior:
The documentation currently states:
"The use of contract parameters syntax conflicts with using an init() function or declaring persistent state variables via the contract fields syntax."
But it does not explicitly mention that declaring contract-level constants alongside parameters is a valid and supported pattern.
Why this matters:
- Explicitly documenting this valid behavior avoids confusion.
- Users currently might incorrectly assume that parameters and constants cannot be combined due to unclear documentation.
Suggested fix:
- Update the documentation to clearly mention that contract parameters can be combined with internal constants, explicitly confirming that this is allowed and supported.
LLM Fuzzing discovery (see #2490)
Minimal reproducible snippet:
Actual behavior:
The compiler correctly accepts contracts declaring parameters alongside internal constants.
However, this valid combination is not mentioned in the documentation.
Expected behavior:
The documentation currently states:
But it does not explicitly mention that declaring contract-level constants alongside parameters is a valid and supported pattern.
Why this matters:
Suggested fix:
LLM Fuzzing discovery (see #2490)