[Issue 2799] New: "out" contractual clause fails to compile for const returns

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 4 09:59:12 PDT 2009


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

           Summary: "out" contractual clause fails to compile for const
                    returns
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


S fun(S)(S a)
out(result)
{
}
body
{
    return a;
}

void main(string[] args)
{
    const char[] a = "a";
    fun(a);
}

Compiled in debug mode:

./test.d(25): Error: variable test.fun!(const(char[])).fun.result cannot modify
const
./test.d(35): Error: template instance test.fun!(const(char[])) error
instantiating


-- 



More information about the Digitalmars-d-bugs mailing list