Fix Trac #783: improve short-cutting literals in the type checker