Close out #9155

Add a test to make sure it works and switch a private struct over to a
newtype.

Closes #9155
Merge pull request #9697 from sfackler/issue_9155

Close out #9155