www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11047] New: UDA + getAttributes bypass purity/safety check

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

           Summary: UDA + getAttributes bypass purity/safety check
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: maxim maxim-fomin.ru



---
Code from February thread:
http://www.digitalmars.com/d/archives/digitalmars/D/Possible_UDA_bug_190800.html

import std.stdio;
int x;
 (write(x++),writeln()) void foo(){}

 safe pure void main(){
    __traits(getAttributes, foo);
    __traits(getAttributes, foo)[0];
    __traits(getAttributes, foo)[0];
    //write(x++), writeln(); // Error: ...
}

By the way, irrespective of attributes, the issue raised in the thread
regarding validity of code above should be at least documented (or code
rejected if considered to be a bug).

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