Error: variable `impl` cannot be modified at compile time

zoujiaqing zoujiaqing at gmail.com
Fri May 13 19:39:27 UTC 2022


```bash
% git clone https://github.com/kerisy/archttp.git
% cd archttp/
% dub build --compiler=dmd
Performing "debug" build using dmd for x86_64.
archttp 0.0.1+commit.3.g70d44ef: building configuration 
"library"...
../../.dub/packages/nbuff-0.1.14/nbuff/source/nbuff/buffer.d(74,25): Deprecation: `catch` statement without an exception specification is deprecated
../../.dub/packages/nbuff-0.1.14/nbuff/source/nbuff/buffer.d(74,25):        use `catch(Throwable)` for old behavior
SSE: false
/opt/dmd/osx/bin/../../src/phobos/std/stdio.d(5190,5): Error: 
variable `impl` cannot be modified at compile time
/opt/dmd/osx/bin/../../src/phobos/std/stdio.d(4130,12):        
called from here: `makeGlobal()`
/opt/dmd/osx/bin/../../src/phobos/std/stdio.d(4220,18):        
called from here: `trustedStdout()`
```

Why can't we use writeln in constructors?
Comment out writeln so that the code will compile properly!


More information about the Digitalmars-d-learn mailing list