avoid overwriting proofsEnabled
through default parameter
#1827
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wouldn't work because
compile()
sets the internal flag totrue
no matter what since that's the default parameter. The fix is to specify no default parameter (undefined
by default) and only setting the internal flag if the developer actually passes in a value. This is backwards compatible because 1) the API doesn't change and 2) the internal flag is still initiated withtrue
so its behavior stays the samethanks for pointing this out @rpanic