explicitly temporary or permanent alias
monkyyy
crazymonkyyy at gmail.com
Sat Oct 12 18:47:28 UTC 2024
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
```d
alias bar=Seq!();
static foreach(...){
...//something that triggers bugs
}
bar=__traits(delete_alias);//marks bar for deletion
```
```d
alias bar=Seq!();
bar=__traits(keep_alias);//turn off optimizations
static foreach(...){
...//something that triggers bugs
}
foo=bar;//foo should be correct now
```
More information about the dip.ideas
mailing list