added if(NO){…} around [target property]

This code should never be called at runtime, it is only intended to provide compile-time errors.

By adding this if statement the code will not be called at runtime, and it will even be optimised out by the compiler. This avoids possibly-undesirable side effects.