fix(CastTo): add missing `self` parameter
refactor(CastTo): move bound from parameter list to where clause