"all functions are templates" flag

monkyyy crazymonkyyy at gmail.com
Sun Jun 23 17:18:11 UTC 2024


```d
import std;
auto foo()(){static assert(0);}
auto bar(){static assert(0);}
void main(){
     "hello world".writeln;
}
```

In the above code, foo doesnt break, bar does.

In the vain of removing the "unreachable statement" error and 
reducing phoboes interdependence( 
https://forum.dlang.org/post/xiprhwrxykatbhlhhcru@forum.dlang.org), have a debug flag that will treat bar as foo, with an empty template header. So only used code breaks compiles.

In wasm with a broken libc, phoboes is unusable, for silly 
reasons like t_time being undefined so I cant use anything that 
imports chains to core.*, which as far as I know is all of Phobos

`-templateify`?


More information about the dip.ideas mailing list