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


--- Comment #0 from Mathias Baumann <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



--- Comment #1 from Mathias Baumann <mathias.baumann sociomantic.com>
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


--- Comment #2 from Dicebot <public dicebot.lv> 2014-03-06 06:25:53 PST ---
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


--- Comment #3 from Dicebot <public dicebot.lv> 2014-03-19 02:30:22 PDT ---
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