[Issue 5416] null should have a type of its own

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 27 02:09:15 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5416


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch


--- Comment #3 from timon.gehr at gmx.ch 2011-10-27 02:07:54 PDT ---
(In reply to comment #1)
> Also if you pass null to a template it completely looses its implict conversion
> abilites. See following example.
> 
> void foo(Object o){
> }
> 
> void fooHelper(T)(T o){
>   foo(o);
> }
> 
> void main(string[] args){
>   fooHelper(null); //can not implicitly convert void* to Object
> }
> 
> This also stops std.conv.emplace to work correctly with constructors you want
> to pass null to.

This is still true if 'Object' is replaced by Object[], 'null' is replaced by
'[]' and 'void*' by 'void[]'. Therefore, '[]' needs an own type too.

(I think it is the same issue, or should I file a separate bug for it?)

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


More information about the Digitalmars-d-bugs mailing list