I summarized some recent Project ValhallaLW2 "inline types" progress that was made public recently in my blog post "Valhalla LW2 Progress - Inline Types." In this post, I illustrate some of the concepts summarized in that post with code examples executed against recently released Valhalla Early Access Build jdk-14-valhalla+1-8 (2019/7/4). All code examples featured in this post are available on GitHub.
The OpenJDK Wiki page "LW2" provides an illustrative example of inline types via source code for a class called "InlineType
." My example makes some minor adaptions and additions to this class and is available on GitHub as a class called InlineTypeExample
. Some items that stand out immediately when reviewing this source code are the presence of the keyword inline
and the presence of the ?
in the Comparable
's generic parameter.