• P
    Change Color Color handling to use binding instead of lookup. · 92b896ba
    pgavlin 提交于
    The Color Color handling in the binder originally used lookup to decide the meaning of an ambiguous identifier as a simple name or type name instead of binding. This was done for two reasons:
    - Binding is more expensive than lookup
    - Binding may have side effects that are undesirable depending on how the Color Color binding is ultimately resolved
    
    Unfortunately, this is not correct: the meaning of an identifier as outlined in the spec is defined by binding. This caused the compiler to incorrectly fail to recognize Color Color in situations where a simple name or type name lookup is ambiguous but a bind of the same is not. This change replaces the lookups used in Color Color with binds, which brings Roslyn's behavior back in line with Dev12 and the spec in cases that fit such cases.
    
    This change is likely to be slightly perf-positive in cases involving a simple name that does not bind to a symbol that qualifies for the Color Color rule: in this case, the old code performed a lookup followed by a bind, whereas the new code simply performs a bind and returns the result. There is likely to be a perf penalty in a true Color Color case, however, as the bound node is larger and the new code is unconditionally binding the type even in the case where the type will not be used (whereas the old code would simply look up the type).
    ***NO_CI***
     (changeset 1385215)
    92b896ba
CSharpSemanticModel.cs 245.3 KB