Reject casts to unsized types

This closes issue #17441 and generally gives more helpful diagnostics.
I patterned it after some of the messages in the existing code, e.g. "cast to nil: `{}` as `{}`".  I agree it's unnecessary to show the actual type.