Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 11 Optional.isEmpty causes compile error #209

Open
jestan opened this issue Dec 16, 2022 · 1 comment
Open

Java 11 Optional.isEmpty causes compile error #209

jestan opened this issue Dec 16, 2022 · 1 comment

Comments

@jestan
Copy link

jestan commented Dec 16, 2022

I am using latest snapshot version of the plugin (0.21-SNAPSHOT) and using Optional.isEmpty method causes a compile error.

j2cl build prints an error like this

cannot find symbol
  symbol:   method isEmpty()

According to J2CL repo, this method seems to be supported https://github.com/google/j2cl/blob/master/jre/java/java/util/Optional.java#L60

I am wondering why it doesn't work as expected?

@niloc132
Copy link
Member

Thanks for the bug report, can you post a little more of your log or a simple test case project?

The only guess I have right now is that it was added in Java 11, and the plugin is presently limited to Java 8, but that should still allow the jre emulation to provide methods not otherwise present in the traditional JRE (this is how some specific Map specialization works, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants