Newtype structs as immediates

Address #6612 and fixes #5321.