[code-reflection] RFR: 8374550: API for casting Value to Op.Result and Block.Parameter [v3]
Paul Sandoz
psandoz at openjdk.org
Tue Jan 6 17:50:44 UTC 2026
On Tue, 6 Jan 2026 15:58:21 GMT, Gary Frost <gfrost at openjdk.org> wrote:
> Again Paul can make the final call on this.
The approach taken was to keep in sync with the same [idiom](https://github.com/openjdk/jdk-sandbox/blob/json/src/java.base/share/classes/java/util/json/JsonValue.java#L249) proposed in the JSON API, and update as that updates when it is reviewed.
The rational for this idiom is they are like assertions, so any throwing indicates an incorrect program rather than something actionable the program would do when an exception is thrown, so that influenced the name. Otherwise, for conditional cases patterns can be used directly.
More generally we may be missing a language feature that supports assignment from a partial pattern as if it were total and throwing a match failed exception otherwise.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/816#discussion_r2665735632
More information about the babylon-dev
mailing list