pathologically simple hotloading RE: compiler bugs
monkyyy
crazymonkyyy at gmail.com
Tue Jun 9 00:41:38 UTC 2026
On Tuesday, 9 June 2026 at 00:03:37 UTC, Richard (Rikki) Andrew
Cattermole wrote:
> Thank you for doing this, I'm adding it to my list of
> references showing why we need linker lists.
---
> @Route("/path") // but actually is: @Route!myRoute("/path")
> void myRoute() {
>
> }
>
> void main() {
> import std.stdio;
> foreach(immutable(RouteInfo)* route; routes) {
> writeln(route.path);
> }
> }
Id suggest something more general, maybe enum slices are mutable
compile time if they have a pragma:
```d
pragma(ctmutablity)
enum int[] foo;
unittest{
foo.writeln;//1,2
}
unittest{
foo~=1;
//pragma(mgs,foo.stringof);//"error compile time appended enums
are unsafe to access at compile time because we hate fun"
}
unittest{
foo~=2;
}
```
```d
pragma(ctmutablity)
void*[] foo;
pragma(ctmutablity)
void function()[] bar;
void myroute(){}
foo~=&myroute;
```
More information about the Digitalmars-d-learn
mailing list