fix warn
Merge pull request #7532 from lite3/object_to_luaval

replace dynamic_cast to std::is_base_of
[ci skip]
[ci skip]
Merge pull request #7588 from Dhilan007/v3

fix warn