In a setter method, setting the same field on a different instance results in a compiler error "Cannot use field accessor inside accessor itself - use & operator."
Example:
class A
{
A? child := null
|Event| handler
{
get { &handler }
set
{
&handler = it;
if (child != null)
{
child.handler = it // ERROR
}
}
}
}
qualidafialSat 18 Sep 2010
My current workaround is to use a private setter:
|Event| handler
{
get { &handler }
set
{
&handler = it;
if (child != null)
{
child.setHandler(it) // works fine
}
}
}
private Void setHandler(|Event| val)
{
handler = val
}
qualidafial Sat 18 Sep 2010
In a setter method, setting the same field on a different instance results in a compiler error "Cannot use field accessor inside accessor itself - use
&
operator."Example:
qualidafial Sat 18 Sep 2010
My current workaround is to use a private setter:
brian Sat 18 Sep 2010
Promoted to ticket #1215 and assigned to brian
brian Wed 22 Sep 2010
Ticket resolved in 1.0.56
changeset