Type conversion in class constraint

In reply to IvanGrafskiy:
Cast to int worked for me, or at least it compiled

amp_dist: coverpoint int'(x**2 + y**2)

You need to explain what didn’t work for you.