Minor optimization to the compiler code that checks entity ancestors for static binding optimizations