www.digitalmars.com         C & C++   DMDScript  

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


           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

--- Comment #0 from Maxim Fomin <maxim maxim-fomin.ru> 2013-09-15 13:59:24 PDT
Code from February thread:

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