Alias reassignment has various bugs, including regressions, in an attempt to optimize it. Sometimes I want a symbol to survive, other time I(by which i mean core devs) want it deleted and hoping a redesign to a static foreach improves compile times.
I expect it will be years before its nailed down and correct.
I suggest two new traits __traits(delete_alias)
and __traits(keep_alias)
, that explicitly keep or delete aliases a work arounds
alias bar=Seq!();
static foreach(...){
...//something that triggers bugs
}
bar=__traits(delete_alias);//marks bar for deletion
alias bar=Seq!();
bar=__traits(keep_alias);//turn off optimizations
static foreach(...){
...//something that triggers bugs
}
foo=bar;//foo should be correct now