Parameterized NTA on ASTNode do not work with concurrent.
This does not work with concurrent :
syn nta A ASTNode.b(int n) = (n == 0) ? new B(): new A();
See test in PR:
Comments (4)
-
-
A workaround for this issue is to add a new subtype of
ASTNode
, and move the attribute to the new subtype. Then make verything else that extendsASTNode
extend the new type instead. This has the added advantage of removing the attributes fromOpt
andList
. -
The List proxy object does not need to be a list, and it can be lazily initialized if wrapped in an
AtomicReference
in the concurrent mode.See issue
#112for more discussion about the NTA proxy objects. -
- changed status to resolved
Fix NTA initialization recursion in concurrent mode
NTA proxy object initialization would crash in recursion in concurrent mode for parameterized NTAs declared on ASTNode because the proxy object initialization was not lazy.
This changes NTA proxy object initialization to be lazy, as in the non-concurrent mode. This is done with AtomicReference to avoid initialization data race.
fixes
#287(bitbucket)→ <<cset 7f1507530247>>
- Log in to comment
This is caused by the non-lazy initialization of a cache object in ASTNode that uses a List object for the cache. This causes an initialization loop.