Nate Ebel
1 min readNov 2, 2017

--

It does compile, but you’re correct that it’s somewhat incorrect or misleading.

If recentQueries is defined like this (as in the original post),

The version shown in the original post

subsequent ? operators aren’t needed, but it does warn about the unnecessary safe call.

However, if recentQueries itself might be null when defined like this,

then the safe calls are needed.

Thanks for pointing this out. I’m going to update the example to be (hopefully) more correct and give a little more context

--

--

Nate Ebel
Nate Ebel

Written by Nate Ebel

Building great software and helping others do the same.

No responses yet