www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10871] New: Typedef doesn't work with is null

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

           Summary: Typedef doesn't work with is null
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: john.loughran.colvin gmail.com



23:05:22 BST ---
import std.typecons;

alias Typedef!(void*) VP;

void main()
{
    VP vp; 
    assert(vp is null);  //won't compile
}

Error: incompatible types for ((vp) is (null)): 'Typedef!(void*, null)' and
'typeof(null)'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 22 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10871


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

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



15:09:02 PDT ---
I'm not sure how we could implement this, we don't have an "opIs" operator.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 22 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10871




23:17:08 BST ---

 I'm not sure how we could implement this, we don't have an "opIs" operator.
yeah I have no idea either. Is there any other way of getting something like a type-safe alias? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 22 2013