www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Does the compiler check for safe?

reply Charles Hixson via Digitalmars-d-announce writes:
I took some code that was annotated safe, and modified it to use a 
buffer internal to the class, and an offset counter.  Some of the 
routines adjusted the counter.  I forgot to remove the  "safe" annotation.

It compiled without error.  So...
1) The compiler didn't check for safety
2) It counts as safe if you only modify local-to-the-class variables 
(and I misunderstood).
or
3) This error is only detected on execution

But which?

(I'm still writing the code, so I can't yet try to execute it, and I 
took off the safe annotation because after I read the definition in TDPL 
it seemed a mistaken annotation.  But perhaps I misunderstand.)
May 05 2015
next sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
Can you post the class in question and show where the safe 
annotation was too?
May 05 2015
parent "deadalnix" <deadalnix gmail.com> writes:
On Tuesday, 5 May 2015 at 19:32:26 UTC, Adam D. Ruppe wrote:
 Can you post the class in question and show where the safe 
 annotation was too?
And why the f*** is that in announce ?
May 05 2015
prev sibling parent reply Charles Hixson via Digitalmars-d-announce writes:
It was in announce because I made a mistake in posting.
May 05 2015
parent "Baz" <bb.temp gmx.com> writes:
On Tuesday, 5 May 2015 at 21:09:45 UTC, Charles Hixson wrote:
 It was in announce because I made a mistake in posting.
Yes of course, in a safe funct just try to call a non-safe one, to call a delegate or even to cast something and you'll be able to verify that by yourself thanks to the error messages.
May 05 2015