Can we just have struct inheritence already?

Walter Bright newshound2 at digitalmars.com
Thu Jun 13 21:49:56 UTC 2019


On 6/13/2019 1:25 PM, Timon Gehr wrote:
> On 13.06.19 09:27, Walter Bright wrote:
>> The spec's wrong, because it doesn't do that.
> 
> Memory safety implies no undefined behavior. The only way the spec can be wrong 
> [1] is if you say that corrupting memory has defined behavior in D, in which 
> case the spec would be too weak, and not too strong like you are implying. 
> Otherwise, "memory safe" and "no undefined behavior" are equivalent.

I've already agreed that an uninitialized int should have an undefined value, 
not undefined behavior :-)

The spec does indeed lack precision with these terms, and it's something well 
worth addressing.


> [1] Assuming here that we accept that @safe successfully protects against memory 
> corruption, ignoring assumptions that need to be made on @trusted functions.

The spec should be clear that @trusted functions must present an @safe interface.


More information about the Digitalmars-d mailing list