Compiler error message not clear for Valhalla EA 2

David Alayachew davidalayachew at gmail.com
Wed Oct 29 04:27:55 UTC 2025


Hello @valhalla-dev <valhalla-dev at openjdk.org>,

While testing out the new Valhalla EA that came out a few days ago, I ran
into the following compiler error.

Here is a minified example.

public value class abc
{

        public abc()
        {
                throw new UnsupportedOperationException();
        }

        public static void someHelperMethod()
        {}

}

And here is the compiler error message.

$ java --enable-preview abc.java
abc.java:5: error: unreachable statement
        {
        ^
1 error
error: compilation failed


That location is the opening curly brace of the constructor.

Can we have a more clear error message?

Thank you for your time and consideration.
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20251029/738bbcb3/attachment-0001.htm>


More information about the valhalla-dev mailing list