experimental switch for generic compileTime, remove typeof
behavior
#24230
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.
fixes #24228, refs #22022
The
typeof
behavior from #22022 causes issues like #24228, but it's required for the procdeclval
in the packagestew
to keep working as expected with the rest of #22022. To accomodate this, the generic compileTime proc behavior in #22022 is now opt-in with the switch--experimental:genericProcCompileTime
, so that packages can continue to work until we have a proper design forcompileTime
.Another option instead of using an experimental switch would be to add a pragma like
constantFold
that needs to be added to individual generic procs to enable compileTime folding for them, maybe for all procs eventually (it would break code currently if required for all procs). But this is a language addition.Will add to changelog if accepted. Mutually exclusive with #24229.