Пример #1
0
        /* See https://github.com/dotnet/runtime/blob/v5.0.0-preview.6.20305.6/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs#L1522-L1532
         * FieldOffsetAttribute        field                           Don't know that it's needed for ref assembly. TODO for API tracking.
         * SerializableAttribute       class, struct, enum, delegate   Synthesized by Roslyn
         * MarshalAsAttribute          parameter, field, return-value  Not API
         * ComImportAttribute          class, interface                Handled here. Essential for ref assembly because it determines whether you can omit the ref keyword when passing arguments to ref parameters..
         * NonSerializedAttribute      field                           Don't know that it's needed for ref assembly. TODO for API tracking.
         * InAttribute                 parameter                       Handled in syntax
         * OutAttribute                parameter                       Handled in syntax
         * OptionalAttribute           parameter                       Handled in syntax
         * DllImportAttribute          method                          Not API
         * PreserveSigAttribute        method                          Not API
         * TypeForwardedToAttribute    assembly                        TODO
         *
         * Not a runtime pseudo-custom attribute but the C# language equivalent:
         * MethodImplAttribute         method, constructor             Handled here. Needed to avoid warnings when using extern.
         */

        public static IEnumerable <AttributeData> GenerateApiAttributes(IAssemblySymbol assembly)
        {
            if (assembly.GetForwardedTypes().Any())
            {
                throw new NotImplementedException("TODO: TypeForwardedToAttribute");
            }

            yield break;
        }