Skip to content

Document that contract parameters can be mixed with contract-level constants #3461

@Gusarich

Description

@Gusarich

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    activity: llm-fuzzingIssues found using LLM fuzzingkind: docsDocumentation for docs.tact-lang.org kept in docs folder

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions