DIP 1017--Add Bottom Type--Final Review

Johannes Loher johannes.loher at fg4f.de
Tue Jan 15 18:51:13 UTC 2019


On Tuesday, 15 January 2019 at 18:21:25 UTC, Johannes Loher wrote:
> [...]

17.
The DIP does not explicitly state when a function can be declared 
to return `Tbottom` and when `Tbottom` is inferred as return type.

Is there a difference between
```
Tbottom fun()
{
     return assert(0);
}
```

and

```
Tbottom fun()
{
     assert(0);
}
```
?

Will inference only work if expressions evaluating to `Tbottom` 
are returned, or is inference for simple things like

```
auto fun()
{
     while(true) {}
}
```

planned? (Obviously this cannot be done in all cases as it is 
equivalent to the halting problem)



More information about the Digitalmars-d mailing list