Add dyn_cast<> support to YAML I/O's IO class