Skip to content

Add ParamCollectionAttribute #99385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\NullableContextAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\NullablePublicOnlyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ReferenceAssemblyAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\ParamCollectionAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\PreserveBaseOverridesAttribute.cs" />
Expand Down Expand Up @@ -2762,4 +2763,4 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Numerics\IUnaryPlusOperators.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Numerics\IUnsignedNumber.cs" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Indicates that a method will allow a variable number of arguments in its invocation.
/// </summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
public sealed class ParamCollectionAttribute : Attribute
{
}
}
5 changes: 5 additions & 0 deletions src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13059,6 +13059,11 @@ public sealed partial class NullablePublicOnlyAttribute : System.Attribute
public readonly bool IncludesInternals;
public NullablePublicOnlyAttribute(bool value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
public sealed partial class ParamCollectionAttribute : System.Attribute
{
public ParamCollectionAttribute() { }
}
public partial struct PoolingAsyncValueTaskMethodBuilder
{
private object _dummy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
<Compile Include="System\Runtime\CompilerServices\DefaultInterpolatedStringHandlerTests.cs" />
<Compile Include="System\Runtime\CompilerServices\FormattableStringFactoryTests.cs" />
<Compile Include="System\Runtime\CompilerServices\StrongBoxTests.cs" />
<Compile Include="System\Runtime\CompilerServices\ParamCollectionAttributeTests.cs" />
<Compile Include="System\Runtime\CompilerServices\RuntimeHelpersTests.cs" />
<Compile Include="System\Runtime\ConstrainedExecution\PrePrepareMethodAttributeTests.cs" />
<Compile Include="System\Runtime\ExceptionServices\HandleProcessCorruptedStateExceptions.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Xunit;

namespace System.Runtime.CompilerServices.Tests
{
public static class ParamCollectionAttributeTests
{
[Fact]
public static void Ctor()
{
var attribute = new ParamCollectionAttribute();
}
}
}