예제 #1
0
        public static string GetMemberNameAndInterfaceSymbol(
            Binder binder,
            ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifierOpt,
            string name,
            DiagnosticBag diagnostics,
            out TypeSymbol explicitInterfaceTypeOpt,
            out string aliasQualifierOpt)
        {
            if (explicitInterfaceSpecifierOpt == null)
            {
                explicitInterfaceTypeOpt = null;
                aliasQualifierOpt        = null;
                return(name);
            }

            // Avoid checking constraints when binding explicit interface type since
            // that might result in a recursive attempt to bind the containing class.
            binder = binder.WithAdditionalFlags(BinderFlags.SuppressConstraintChecks | BinderFlags.SuppressObsoleteChecks);

            NameSyntax explicitInterfaceName = explicitInterfaceSpecifierOpt.Name;

            explicitInterfaceTypeOpt = binder.BindType(explicitInterfaceName, diagnostics);
            aliasQualifierOpt        = explicitInterfaceName.GetAliasQualifierOpt();
            return(GetMemberName(name, explicitInterfaceTypeOpt, aliasQualifierOpt));
        }