Example #1
0
        public static DynamicallyAccessedMemberTypes GetMethodReturnValueAnnotation(IMethodSymbol method)
        {
            var returnDamt = method.GetDynamicallyAccessedMemberTypesOnReturnType();

            // Is this a property getter?
            // If there are conflicts between the getter and the property annotation,
            // the getter annotation wins. (But DAMT.None is ignored)
            if (method.MethodKind is MethodKind.PropertyGet && returnDamt == DynamicallyAccessedMemberTypes.None)
            {
                var property = (IPropertySymbol)method.AssociatedSymbol !;
                Debug.Assert(property != null);
                returnDamt = property !.GetDynamicallyAccessedMemberTypes();
            }

            return(returnDamt);
        }