Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0-rc-2
-
None
-
None
Description
import groovy.transform.CompileStatic @CompileStatic public class Test4 { public static void main(String[] args) { new Test4().p(); } public String hello = "Hello "; public void p() { assert ['Hello Jochen', 'Hello Daniel'] == ["Jochen", "Daniel"].stream().map(e -> this.hello + e).toList(); } }
Error message:
java.lang.ClassCastException: class Test4$_p_lambda1 cannot be cast to class Test4 (Test4$_p_lambda1 and Test4 are in unnamed module of loader groovy.lang.GroovyClassLoader$InnerLoader @1e05551b) at Test4$_p_lambda1.doCall(ConsoleScript2:12) at Test4.p(ConsoleScript2:12) at Test4.main(ConsoleScript2:6) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Attachments
Issue Links
- links to