-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow collection expressions with
CreateCompilation
(#71134)
- Loading branch information
Showing
4 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
#if !NET8_0_OR_GREATER | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)] | ||
public sealed class CollectionBuilderAttribute : Attribute | ||
{ | ||
public CollectionBuilderAttribute(Type builderType, string methodName) | ||
{ | ||
BuilderType = builderType; | ||
MethodName = methodName; | ||
} | ||
|
||
public Type BuilderType { get; } | ||
public string MethodName { get; } | ||
} | ||
} | ||
|
||
#else | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
#pragma warning disable RS0016 // Add public types and members to the declared API (this is a supporting forwarder for an internal polyfill API) | ||
[assembly: TypeForwardedTo(typeof(CollectionBuilderAttribute))] | ||
#pragma warning restore RS0016 // Add public types and members to the declared API | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters