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


--- Comment #0 from Jeroen Bollen <jbinero gmail.com> 2014-04-08 14:12:22 PDT
---
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


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2014-04-08
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



--- Comment #2 from Jeroen Bollen <jbinero gmail.com> 2014-04-08 14:29:05 PDT
---
(In reply to comment #1)
 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



--- Comment #3 from Jeroen Bollen <jbinero gmail.com> 2014-04-08 14:31:24 PDT
---
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


--- Comment #4 from Jeroen Bollen <jbinero gmail.com> 2014-04-08 14:39:44 PDT
---
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


--- Comment #5 from Kenji Hara <k.hara.pg gmail.com> 2014-04-08 19:43:21 PDT ---
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