Discussion Thread: DIP 1034--Add a Bottom Type (reboot)--Community Review Round 1
Dennis
dkorpel at gmail.com
Wed May 6 19:07:27 UTC 2020
On Wednesday, 6 May 2020 at 17:03:56 UTC, Meta wrote:
> Maybe this is not a realistic scenario, but I think it should
> at least be considered that this will cause code that
> previously seemed fairly innocuous to now fail to compile, for
> a reason that may not be obvious.
It doesn't compile today, as it would be instantiated with a
void[]:
```
import std;
void main() {writeln([].group());}
```
> instance std.algorithm.iteration.Group!("a == b", void[]) does
> not match template declaration ...
You do raise a very good point though, I don't want to introduce
a lot of `static if (is(T == noreturn[]))` to make range
algorithms work with []. I'm considering changing it so that
local noreturn variables give an error on usage instead of
initialization.
I need think about the implications of that though. I'll try to
make a prototype implementation before final review and see if I
can make [] work with range functions in Phobos.
More information about the Digitalmars-d
mailing list