Fix #626

CastExpression disallowed casting an expression of type T to type T. This "self-cast" should be perfectly legal, so add some tests and then fix it.