Fix copy/paste to refer to the relevant type (ProgramPoint instead of TypeLoc).

Post commit review feedback on r175812 from Jordan Rose.
Simplify code to use castAs rather than getAs + assert.

Post commit review feedback on r175812 from Jordan Rose.