The propagation of typecasts prematurely into expressions is an old PCC bug fixed years ago when the "repainting" stuff was added. It would sure be nice if people would start with the latest version of software when they do their adaptations.