Comptime function calls being memoised or not depending on return type #5674
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Uh oh!
There was an error while loading. Please reload this page.
(N.B.: Some details may be incorrect. I can't compile atm, so i can't check.)
The following code prints
1
:This is because the call to
getValue
at comptime is memoised.The following code prints
3
:This indicates that
getValue
is not being memoised.Not sure if this is a bug or overzealous special casing, but either way it's not right. Either both
getValue
's should be memoised, or neither should. (Personally I think comptime closures are a mistake -- see #5718.)The text was updated successfully, but these errors were encountered: