Add EE support for My.InternalXmlHelper
Two things were preventing the EE from finding the type, which is needed for XML literal operations in VB: 1. It is marked internal and the accessibility check happened in AssemblySymbol, rather than the binder, so it was not hijacked. 2. It is marked with EmbeddedAttribute and is not from the SourceModule of the compilation (it's from the module of the current frame). We can resolve both of these problems by doing the lookups as though we were in the module containing the current frame. This required two changes: 1. Remove InternalXmlHelper from WellKnownTypes and give it its own code path. Explicitly pass the appropriate module symbol to the new helper. 2. In Binder.CheckViability, look for a containing module before falling back on the SourceModule of the compilation. By preserving the accessibility checks during type lookup (but doing them from the perspective of a different assembly), we retain the compiler's protection against pulling in a copy from each VB reference (i.e. ambiguity). The main caveat is that My.InternalXmlHelper will not be found if it was not embedded in the module containing the current frame - even if it is unambiguously available in a referenced assembly. Breaking change: unlike dev12, roslyn will only find My.InternalXmlHelper in the source module. Fixes #964
Showing
想要评论请 注册 或 登录