On Thu, 9 Jul 2026 21:48:06 GMT, Chen Liang <[email protected]> wrote:

>> doc/value-class-preview.md line 27:
>> 
>>> 25: source files where these occurrences are replaced by `value class` and
>>> 26: `value record`, respectively.
>>> 27: 
>> 
>> So, with the current system, consequently, any needed testing of "is preview 
>> enabled" must be done at runtime rather than via a compile-time macro?
>> (The other little code gen systems used in the JDK have a more expressive 
>> set of primitives. In my estimation, the simple system here is good for the 
>> purpose it is being used for, but it is helpful to document it here.)
>
> Yes. I don't understand how a compile-time macro can work - we have one 
> runtime that must support both preview-on and preview-off runs.

In the space of generate-different-source-code-from-a-template solutions, it 
would be possible to have code conditionally emitted for one case but not the 
other. The solution used for JEP 401 currently just uncomments the `value` 
modifier.

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2633#discussion_r3561111263

Reply via email to