Shouldn't invalid references like this fail at compile time?

Mike Franklin slavo5150 at yahoo.com
Tue Jan 23 01:51:40 UTC 2018


On Tuesday, 23 January 2018 at 01:08:19 UTC, ag0aep6g wrote:

> The real question is about this line:
>
>     p2 = ls[0];
>
> That's an out-of-bounds access, and the compiler does not catch 
> this statically. Instead, it inserts bounds-checking code that 
> crashes the program safely with an `Error`.

In trying to work out a solution to that, I ran across this 
oddity:

https://issues.dlang.org/show_bug.cgi?id=18282



More information about the Digitalmars-d mailing list