I have a JSON object:
var x: JSON = JSON([:])
x["1"].intValue = 1 //Correct
x["2"].arrayValue = [JSON("2")] //Error
x["3"].dictionaryValue = [3:JSON("3")] //Error
I am able to assign an integer to x, but I am not able to assign any JSON array or any JSON dictionary. What am I doing wrong and how do I solve it?