Make valid_type? public
Merge pull request #9283 from rubys/master

Make valid_type? public