Make tc-literal deal with complicated expected types better.

Also fixes bug in literal heterogeneous vector typing.

Closes PR 13842.