www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12549] New: Immutable can't be casted when using nested pointers

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

           Summary: Immutable can't be casted when using nested pointers
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: jbinero gmail.com



---
Created an attachment (id=1343)
example file

When using nested pointers, DMD seems to not be able to realize immutable is
also constant. It'll result in errors similar to:

"function app.test2 (const(char)** test2) is not callable using argument types
(immutable(char)**)"

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12549


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



23:24:15 CEST ---
Likely dupe of https://d.puremagic.com/issues/show_bug.cgi?id=4251. See the
comment http://d.puremagic.com/issues/show_bug.cgi?id=4251#c9.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12549




---

 Likely dupe of https://d.puremagic.com/issues/show_bug.cgi?id=4251. See the
 comment http://d.puremagic.com/issues/show_bug.cgi?id=4251#c9.
That issue dates from 2 years ago, and it is marked as resolved, while this bug still occurs in the head and latest version (2.065) of DMD. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 08 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12549




---
Oh I see what you meant now. But when changing a pointer you should only allow
it to point at what its type tells it to, a constant character in this case!
That on its own is a bug.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12549


Jeroen Bollen <jbinero gmail.com> changed:

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



---
I see now, the poiter pointing to an immutable type can be changed to point to
a const (mutable) type.

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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12549


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|DUPLICATE                   |INVALID



This is an invalid issue, because of the issue 4251.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2014