Prevent unsized types being stored in variables

Closes #13376.