On Thursday, 24 July 2014 at 15:34:22 UTC, Ali Çehreli wrote:
On 07/24/2014 08:29 AM, Pavel wrote:

writeln(parsed["fail"] == null);

Now compiler complains:

Error: incompatible types for ((parsed.opIndex("fail")) == (null)):
'JSONValue' and 'typeof(null)'


WAT?!

Comparing against null should be done with the 'is' operator, not the == operator:

    if (x is null)

Ali

My compiler disagreed:

app.d(8): Error: incompatible types for ((parsed.opIndex("fail")) is (null)): 'JSONValue' and 'typeof(null)'

Reply via email to