Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.2
-
None
Description
This class works as expected:
class RoutingInfo { String to void hello() { this.to ?= 'alice' } }
Trying to use Elvis assignment from a class in another file (it must be another file) causes the STC to lose track of the type of the RHS and complain that it can't assign Object to String:
class Other { void world() { new RoutingInfo().to ?= 'bob' } }
Groovy:[Static type checking] - Cannot assign value of type java.lang.Object to variable of type java.lang.String
Attachments
Issue Links
- is related to
-
GROOVY-10419 STC: stack overflow for elvis assignment with explicit setter
- Closed