rfc:new_in_initializers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:new_in_initializers [2021/06/15 14:57] – nikic | rfc:new_in_initializers [2021/06/16 07:46] – nikic | ||
---|---|---|---|
Line 87: | Line 87: | ||
For non-static property initializers, | For non-static property initializers, | ||
- | Performing the initialization by injecting code in the constructor avoids the issue, but requires that constructor to actually be called. In particular, this would necessitate generating constructors for classes that do not explicitly declare them, and the disciplined invocation of such constructors from potential | + | Performing the initialization by injecting code in the constructor avoids the issue, but requires that constructor to actually be called. In particular, this would necessitate generating constructors for classes that do not explicitly declare them, and the disciplined invocation of such constructors from potential |
For static property initializers and class constant initializers a different evaluation order issue arises. Currently, these initializers are evaluated lazily the first time a class is used in a certain way. Once initializers can contain potentially side-effecting expressions, | For static property initializers and class constant initializers a different evaluation order issue arises. Currently, these initializers are evaluated lazily the first time a class is used in a certain way. Once initializers can contain potentially side-effecting expressions, | ||
- | The discussion has not yielded a satisfactory solution for these concerns, as such support in these contexts is delayed until such a time as a consensus on the preferred behavior can be reached. | + | As such support in these contexts is delayed until such a time as a consensus on the preferred behavior can be reached. |
==== Order of evaluation ==== | ==== Order of evaluation ==== |
rfc/new_in_initializers.txt · Last modified: 2021/07/14 07:19 by nikic