Instead of checking if code compiles, I think it is a better to check if the symbol exists. This is simpler and should do the same thing.
This should be functionally identical and is much cleaner. Thanks!