Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misuse check: parameters that should've been used #1

Open
BenWoodworth opened this issue Aug 24, 2023 · 1 comment
Open

Misuse check: parameters that should've been used #1

BenWoodworth opened this issue Aug 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@BenWoodworth
Copy link
Owner

At the end of an iteration, if a parameter wasn't used, but was in the previous iteration, then there must be impure control flow occuring. It should be quick to check this after an iteration, and throw an exception if it happens

@BenWoodworth BenWoodworth changed the title Misuse check: parameters that should've been read Misuse check: parameters that should've been used Nov 28, 2023
@BenWoodworth
Copy link
Owner Author

Note that there are cases where it's okay that parameters aren't used. E.g.

parameterize {
    val a by parameterOf('a')

    val b by parameter {
        a // Uses `a`, but this lazy arguments block only runs on the first iteration (a1)

        listOf("${a}1", "${a}2")
    }
}

Because of this, it may be more complex to track, so may not be worth implementing

@BenWoodworth BenWoodworth added the enhancement New feature or request label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant