Newtype structs as immediates

Addresses #6612 and fixes #5321.