www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12300] New: Deprecated variables still accessible using tupleof

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12300

           Summary: Deprecated variables still accessible using tupleof
           Product: D
           Version: D1
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, industry
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: mathias.baumann sociomantic.com



2014-03-05 12:49:51 PST ---
DMD shows inconcistent behavior when checking for the existance of a deprecated
variable in a struct as the code below shows:


-----
module main;

struct S
{
    deprecated int var;
}


void main ()
{
    S s;

    // Works
    static assert ( is ( typeof(s.tupleof[0]) ), "s.tupleof[0] does not exist!"
);

    // Fails
    static assert ( is ( typeof(s.var) ), "s.var does not exist!" );
}
-------

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 05 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12300




2014-03-05 12:52:04 PST ---
A short test showed that it works in D2

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 05 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12300


Dicebot <public dicebot.lv> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |public dicebot.lv



x-post from internal discussion:

-----
It clearly does not work in D2 for me:

$ dmd -de -run test.d 
test.d(17): Error: static assert  "s.var does not exist!"

You may have missed the fact that dmd2 uses different set of flags to control
deprecation behaviour.
-----

I think this is by design and works as intended.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 06 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12300


Dicebot <public dicebot.lv> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



closing after internal discussion as invalid

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