www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2799] New: "out" contractual clause fails to compile for const returns

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: andrei 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


-- 
Apr 04 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2799


Sobirari Muhomori <maxmo pochta.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




--- Comment #1 from Sobirari Muhomori <maxmo pochta.ru>  2009-06-10 02:35:19
PDT ---
More detailed description in bug 2933

*** This issue has been marked as a duplicate of issue 2933 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 10 2009