You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a simple enum java class that define an inner Functional interface, the interface is used a constructor argument for the enum class, enum entires are defined passing a lambada expression of that functional interface.
compiling with j2cl throws a NullPointerException.
To Reproduce
we can reproduce this issue in using the hello world sample:
add the following class next to the HelloWorld.java
this will produce an exception with the following stack trace
ures.wrapAndThrowUnchecked(Futures.java:1546)
at com.google.common.util.concurrent.Futures.getUnchecked(Futures.java:1532)
at com.google.j2cl.transpiler.J2clTranspiler.transpile(J2clTranspiler.java:111)
at com.google.j2cl.transpiler.BazelJ2clBuilder.run(BazelJ2clBuilder.java:74)
at com.google.j2cl.bazel.BazelWorker.processRequest(BazelWorker.java:62)
at com.google.j2cl.bazel.BazelWorker.execute(BazelWorker.java:116)
at com.google.j2cl.bazel.BazelWorker.runPersistentWorker(BazelWorker.java:98)
at com.google.j2cl.bazel.BazelWorker.start(BazelWorker.java:71)
at com.google.j2cl.transpiler.BazelJ2clBuilder.main(BazelJ2clBuilder.java:158)
Caused by: java.lang.NullPointerException
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:1617)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:647)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:1384)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:627)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convertLambdaBody(CompilationUnitBuilder.java:1037)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:1023)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:631)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convertArguments(CompilationUnitBuilder.java:1501)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:299)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:208)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:190)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.convert(CompilationUnitBuilder.java:177)
at com.google.j2cl.frontend.CompilationUnitBuilder$ASTConverter.access$100(CompilationUnitBuilder.java:133)
at com.google.j2cl.frontend.CompilationUnitBuilder.buildCompilationUnit(CompilationUnitBuilder.java:1914)
at com.google.j2cl.frontend.CompilationUnitBuilder.lambda$build$0(CompilationUnitBuilder.java:1936)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.google.j2cl.frontend.CompilationUnitBuilder.build(CompilationUnitBuilder.java:1938)
at com.google.j2cl.transpiler.J2clTranspiler.convertUnits(J2clTranspiler.java:141)
at com.google.j2cl.transpiler.J2clTranspiler.transpileImpl(J2clTranspiler.java:125)
at com.google.j2cl.transpiler.J2clTranspiler.lambda$transpile$0(J2clTranspiler.java:110)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
---8<---8<--- End of log snippet, 791 chars omitted ---8<---8<---
Target //src/main/java/com/google/j2cl/samples/helloworld:helloworld failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.388s, Critical Path: 1.15s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 2 processes: 1 local, 1 worker.
FAILED: Build did NOT complete successfully
for some reason the CurrentType is being Null in the CompilationUnitBuilder during the process of converting the lambda expression body.
expanding the lamda to anonymous classes works.
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a simple enum java class that define an inner Functional interface, the interface is used a constructor argument for the enum class, enum entires are defined passing a lambada expression of that functional interface.
compiling with j2cl throws a NullPointerException.
To Reproduce
we can reproduce this issue in using the hello world sample:
this will produce an exception with the following stack trace
for some reason the CurrentType is being Null in the CompilationUnitBuilder during the process of converting the lambda expression body.
The text was updated successfully, but these errors were encountered: