Force type check when assigning a custom attribute