Skip to content

Commit

Permalink
Add SetsRequiredMembersAttribute class
Browse files Browse the repository at this point in the history
- Added `SetsRequiredMembersAttribute.cs` defining a new attribute class `SetsRequiredMembersAttribute` in the `System.Diagnostics.CodeAnalysis` namespace.
- Updated `MissingAttributes.csproj` to include the new file for the `net6.0` target framework.
- The attribute is designed for constructors, marked as `sealed`, and cannot be used multiple times on the same constructor or inherited by derived classes.
  • Loading branch information
Simon Jefferies committed Nov 26, 2024
1 parent d67a73e commit 7477b7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions MissingAttributes/MissingAttributes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<None Include="CompilerFeatureRequiredAttribute.cs" />
<None Include="IsExternalInit.cs" />
<None Include="RequiredMemberAttribute.cs" />
<None Include="SetsRequiredMembersAttribute.cs" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions MissingAttributes/SetsRequiredMembersAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace System.Diagnostics.CodeAnalysis;

[System.AttributeUsage(System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
public sealed class SetsRequiredMembersAttribute : Attribute
{
}

0 comments on commit 7477b7d

Please sign in to comment.