Adds third param to type_cast_with_visiting for debug.