`assert(val->IsObject())`?