On 07/25/2016 05:07 PM, Bahman Movaqar wrote: > Suppose I have the following function: > > public auto max(alias comp, Range)(Range r) > in { > assert(r !is null && !r.empty); > } > body { > // ... > } > > When the function after a series of chained `map` operations, I get the > following error: > > 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?
Thank you people for the answers. >From what I could gather, it's not possible to check for `null` at runtime for reference based types. Am I right? -- Bahman