[Issue 6604] Casting away immutable modifier does nothing

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 5 07:11:22 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6604


Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |thecybershadow at gmail.com
         Resolution|                            |INVALID


--- Comment #1 from Vladimir Panteleev <thecybershadow at gmail.com> 2011-09-05 07:11:12 PDT ---
Casting is the tool which allows you to break D's typesystem. This behavior is
completely expected and is by design. If you use a cast, it's expected that you
know what you're doing.

Note that your code will not compile with @safe:

test.d(5): Error: cast from const(int*) to int* not allowed in safe code

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list