#dbugfix 17592

12345swordy alexanderheistermann at gmail.com
Thu Mar 22 14:48:04 UTC 2018


On Thursday, 22 March 2018 at 02:35:41 UTC, Adam D. Ruppe wrote:
> On Thursday, 22 March 2018 at 01:55:48 UTC, 12345swordy wrote:
>> Are you suggesting that we need runtime version of system/user 
>> attributes?
>
> We already have that in a sense - InvalidMemoryOperationError 
> is thrown if you try to GC allocate from inside a GC 
> destructor. The attributes are supposed to render such runtime 
> errors impossible, catching them at compile time instead.
>
That is not a runtime version of system/user attributes! That is 
custom checking for destructor! Hardly the same.
>>> All classes are dynamic types
>>
>> I do not see it anywhere in the dlang specification that 
>> supports your claim.
>> https://dlang.org/spec/class.html
>
> This is the reason why all D classes have a vtable attached 
> (with attached runtime type info).
C++ classes also have vtables which are typically implemented as 
static arrays at compile time.

Again I do not see it anywhere in the specification that support 
your claim that all classes are dynamic. Otherwise if what your 
saying is true then you should unable to use classes in Better C 
mode, as that involves runtime.
>> Why can't it produce a warning message regarding implied 
>> classes conversion if it detects mismatch attributes?
>
> The entire purpose of OOP inheritance
I think you do not understand the question that I am asking. I am 
not asking to produce an ERROR message here, I am asking to 
produce a WARNING message here. We are dealing with the 
possibility of mismatch attributes, which  seriously can cause 
some nasty bugs to leak, without the programmer noticing.



More information about the Digitalmars-d mailing list