www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11694] New: std.traits.SetFunctionAttributes does not conserve constness

https://d.puremagic.com/issues/show_bug.cgi?id=11694

           Summary: std.traits.SetFunctionAttributes does not conserve
                    constness
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: ellery-newcomer utulsa.edu



18:22:15 PST ---
the code:
import std.traits;

class Z {
    string a() immutable {
        return " 1";
    }
}

pragma(msg ,typeof(&Z.a));
pragma(msg, SetFunctionAttributes!(typeof(&Z.a),
functionLinkage!(typeof(&Z.a)), functionAttributes!(typeof(&Z.a))));

void main() {}

prints out

string function() immutable
string function()

rather than the expected

string function() immutable
string function() immutable

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