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
{{ message }}
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
<<<() -> {
return 42;
}
>>>
<<<java.util.function.Supplier<java.lang.Integer> lambda = () -> {
return 42;
}
;>>>
Exception in thread "main" java.lang.IllegalStateException: statement enter $[ followed by statement enter $[
at com.squareup.javapoet.Util.checkState(Util.java:62)
at com.squareup.javapoet.CodeWriter.emit(CodeWriter.java:284)
at com.squareup.javapoet.CodeWriter.emit(CodeWriter.java:229)
at com.squareup.javapoet.CodeWriter.emitLiteral(CodeWriter.java:365)
at com.squareup.javapoet.CodeWriter.emit(CodeWriter.java:240)
at com.squareup.javapoet.CodeWriter.emit(CodeWriter.java:229)
at com.squareup.javapoet.CodeBlock.toString(CodeBlock.java:97)
at java.base/java.lang.String.valueOf(String.java:2958)
I think this should work, because the assignment is a statement, and because of the lambda syntax the rvalue can also contain statements. But it seems like Javapoet is confused by statements within each other.
The text was updated successfully, but these errors were encountered:
Repro sample:
The first two prints work, the third fails:
I think this should work, because the assignment is a statement, and because of the lambda syntax the rvalue can also contain statements. But it seems like Javapoet is confused by statements within each other.
The text was updated successfully, but these errors were encountered: