Trouble checking for null-ness

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 25 05:47:18 PDT 2016


On Monday, 25 July 2016 at 12:37:18 UTC, Bahman Movaqar wrote:
>     Error: incompatible types for ((r) !is (null)):
> 'MapResult!(__lambda2, SInvoiceLine[])' and 'typeof(null)'
>
> Of course if I remove `r !is null` from the `in` block, 
> everything will work.  But I'm curious; how can I check for a 
> `null` in this case?

You can't. null is not a valid value for the return type of map.


More information about the Digitalmars-d-learn mailing list