Also adds a new class to the test_var_precedence test to check for this type of error in the future. Fixes #9178