www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - override and trusted

reply deadalnix <deadalnix gmail.com> writes:
As suggested, override will propagate function's qualifier of the 
superclass. What about the  trusted attribute ?

It seems to be quite dangerous attribute to propagate. And if we don't, 
we could ends up with strange stuffs dues to  safe inference in the 
subclasse.

I suggest override to propagate  safe in the case of  trusted function 
overload, except if overloaded function is explicitly tagged as  trusted .

 trusted isn't something that we want to propagate automatically.
Mar 11 2012
next sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 03/11/2012 05:16 PM, deadalnix wrote:
 As suggested, override will propagate function's qualifier of the
 superclass. What about the  trusted attribute ?

 It seems to be quite dangerous attribute to propagate. And if we don't,
 we could ends up with strange stuffs dues to  safe inference in the
 subclasse.

 I suggest override to propagate  safe in the case of  trusted function
 overload, except if overloaded function is explicitly tagged as  trusted .

  trusted isn't something that we want to propagate automatically.
+1.
Mar 11 2012
prev sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sun, Mar 11, 2012 at 05:16:06PM +0100, deadalnix wrote:
 As suggested, override will propagate function's qualifier of the
 superclass. What about the  trusted attribute ?
 
 It seems to be quite dangerous attribute to propagate. And if we
 don't, we could ends up with strange stuffs dues to  safe inference
 in the subclasse.
 
 I suggest override to propagate  safe in the case of  trusted
 function overload, except if overloaded function is explicitly
 tagged as  trusted .
 
  trusted isn't something that we want to propagate automatically.
I didn't confirm this, but based on what I observed of dmd recently, I *think* it actually does this already. T -- Error: Keyboard not attached. Press F1 to continue. -- Yoon Ha Lee, CONLANG
Mar 11 2012