www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7272] New: `out` section makes return type `const` in `return` statement

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7272

           Summary: `out` section makes return type `const` in `return`
                    statement
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



---
---
int* f() 
out { } // no errors with `out` section
body {
    immutable(int)* ptr;
    return ptr;
}
---
If `immutable(int)*` is changed to `immutable(void)*` we have the following
error:
`Error: cannot implicitly convert expression (ptr) of type immutable(void)* to
const(int*)` illustrating the issue. Note, that `typeof(f())` and
`typeof(return)` are `int*`.
Maybe concerned with Issue 1313

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 11 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7272


Kenji Hara <k.hara.pg gmail.com> changed:

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



I've posted a patch to fix 1313, and confirmed that this is a dup of it.

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 12 2012