Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0-rc-2
-
None
-
None
Description
Follow up to GROOVY-9332 and GROOVY-9333. Consider the following:
@groovy.transform.CompileStatic class ThisTest { private final ThisTest that = this void m() { java.util.function.Predicate<ThisTest> p1 = (ThisTest t1) -> { java.util.function.Predicate<ThisTest> p2 = (ThisTest t2) -> { assert this === t1 && this === t2 } p2.test(t1) } p1.test(that) p1.test(this) } } new ThisTest().m()
java.lang.ClassCastException: ThisTest$_m_lambda1 cannot be cast to ThisTest
at ThisTest$_m_lambda1$_lambda2.doCall(TestScript4.groovy:9)
at ThisTest$_m_lambda1.doCall(TestScript4.groovy:11)
at ThisTest.m(TestScript4.groovy:13)
at ThisTest$m.call(Unknown Source)
Attachments
Issue Links
- links to