Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6-beta-2
-
Fix Version/s: 1.6-rc-1, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The call new Foo([:]) below will lead to infinite recursion.
@Immutable final class Foo { Map bar } new Foo([:])
I guess the above code corresponds to
final class Foo { final Map bar Foo(Map bar) { this(['bar':bar]) } Foo(HashMap args) { this.bar = args['bar'].asImmutable() } } new Foo([:])
It will never reach the termitating HashMap constructor.
Solution1: Generate only tuple-based ctor if single field. Do field initializations in this ctor.
Activity
Guillaume Laforge
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Fix Version/s | 1.6-rc-1 [ 14009 ] |
blackdrag blackdrag
made changes -
| Resolution | Fixed [ 1 ] | |
| Assignee | Jochen Theodorou [ blackdrag ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
Paul King
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
blackdrag blackdrag
made changes -
| Assignee | Jochen Theodorou [ blackdrag ] | Paul King [ paulk ] |
Paul King
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Workaround: call Map-based ctor (HashMap) explicity
new Foo((HashMap) [bar:[:]])