Skip to content
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
11 changes: 11 additions & 0 deletions src/libraries/Microsoft.CSharp/ref/Microsoft.CSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,37 @@ namespace Microsoft.CSharp.RuntimeBinder
public static partial class Binder
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder BinaryOperation(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Linq.Expressions.ExpressionType operation, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder Convert(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Type type, System.Type? context) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder GetIndex(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder GetMember(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, string name, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder Invoke(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder InvokeConstructor(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder InvokeMember(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, string name, System.Collections.Generic.IEnumerable<System.Type>? typeArguments, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder IsEvent(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, string name, System.Type? context) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder SetIndex(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder SetMember(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, string name, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Using dynamic types might cause types or members to be removed by trimmer.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.")]
public static System.Runtime.CompilerServices.CallSiteBinder UnaryOperation(Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags flags, System.Linq.Expressions.ExpressionType operation, System.Type? context, System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>? argumentInfo) { throw null; }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<DefineConstants Condition="'$(EnableComBinder)' == 'true'">$(DefineConstants);ENABLECOMBINDER</DefineConstants>
<AllowUnsafeBlocks Condition="'$(EnableComBinder)' == 'true'">true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);LEGACY_GETRESOURCESTRING_USER</DefineConstants>
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.CSharp.RuntimeBinder
public static class Binder
{
internal const string TrimmerWarning = "Using dynamic types might cause types or members to be removed by trimmer.";
internal const string DynamicCodeWarning = "The 'dynamic' feature requires runtime-code generation, which is incompatible with AOT.";
//////////////////////////////////////////////////////////////////////

/// <summary>
Expand All @@ -28,6 +29,7 @@ public static class Binder
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp binary operation binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder BinaryOperation(
CSharpBinderFlags flags,
ExpressionType operation,
Expand Down Expand Up @@ -56,6 +58,7 @@ public static CallSiteBinder BinaryOperation(
/// <param name="context">The <see cref="Type"/> that indicates where this operation is used.</param>
/// <returns>Returns a new CSharp convert binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder Convert(
CSharpBinderFlags flags,
Type type,
Expand Down Expand Up @@ -83,6 +86,7 @@ public static CallSiteBinder Convert(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp get index binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder GetIndex(
CSharpBinderFlags flags,
Type? context,
Expand All @@ -102,6 +106,7 @@ public static CallSiteBinder GetIndex(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp get member binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder GetMember(
CSharpBinderFlags flags,
string name,
Expand All @@ -122,6 +127,7 @@ public static CallSiteBinder GetMember(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp invoke binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder Invoke(
CSharpBinderFlags flags,
Type? context,
Expand Down Expand Up @@ -150,6 +156,7 @@ public static CallSiteBinder Invoke(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp invoke member binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder InvokeMember(
CSharpBinderFlags flags,
string name,
Expand Down Expand Up @@ -188,6 +195,7 @@ public static CallSiteBinder InvokeMember(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp invoke constructor binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder InvokeConstructor(
CSharpBinderFlags flags,
Type? context,
Expand All @@ -206,6 +214,7 @@ public static CallSiteBinder InvokeConstructor(
/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param>
/// <returns>Returns a new CSharp is event binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder IsEvent(
CSharpBinderFlags flags,
string name,
Expand All @@ -224,6 +233,7 @@ public static CallSiteBinder IsEvent(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp set index binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder SetIndex(
CSharpBinderFlags flags,
Type? context,
Expand All @@ -245,6 +255,7 @@ public static CallSiteBinder SetIndex(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp set member binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder SetMember(
CSharpBinderFlags flags,
string name,
Expand All @@ -267,6 +278,7 @@ public static CallSiteBinder SetMember(
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp unary operation binder.</returns>
[RequiresUnreferencedCode(TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
public static CallSiteBinder UnaryOperation(
CSharpBinderFlags flags,
ExpressionType operation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ internal static class BinderHelper
private static MethodInfo s_SingleIsNaN;

[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal static DynamicMetaObject Bind(
ICSharpBinder action,
RuntimeBinder binder,
Expand Down Expand Up @@ -474,6 +475,7 @@ internal static bool CompareArgInfos(CSharpArgumentInfo[] argInfos, CSharpArgume
}

#if !ENABLECOMBINDER
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal static void ThrowIfUsingDynamicCom(DynamicMetaObject target)
{
if (target.LimitType.IsCOMObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpBinaryOperationBinder : BinaryOperationBinder, ICSharpBinder
{
[ExcludeFromCodeCoverage(Justification = "Name should not be called for this binder")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpConvertBinder : ConvertBinder, ICSharpBinder
{
[ExcludeFromCodeCoverage(Justification = "Name should not be called for this binder")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpGetIndexBinder : GetIndexBinder, ICSharpBinder
{
public string Name => SpecialNames.Indexer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpGetMemberBinder : GetMemberBinder, IInvokeOnGetBinder, ICSharpBinder
{
public BindingFlag BindingFlags => BindingFlag.BIND_RVALUEREQUIRED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Represents a dynamic delegate-like call in C#, providing the binding semantics and the details about the operation.
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
internal sealed class CSharpInvokeBinder : InvokeBinder, ICSharpInvokeOrInvokeMemberBinder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Microsoft.CSharp.RuntimeBinder
{
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpInvokeConstructorBinder : DynamicMetaObjectBinder, ICSharpInvokeOrInvokeMemberBinder
{
public BindingFlag BindingFlags => 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpInvokeMemberBinder : InvokeMemberBinder, ICSharpInvokeOrInvokeMemberBinder
{
public BindingFlag BindingFlags => 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Used to test whether a dynamic member over which += or -= is used is an event member.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpIsEventBinder : DynamicMetaObjectBinder, ICSharpBinder
{
public BindingFlag BindingFlags => 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpSetIndexBinder : SetIndexBinder, ICSharpBinder
{
public string Name => SpecialNames.Indexer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpSetMemberBinder : SetMemberBinder, ICSharpBinder
{
public BindingFlag BindingFlags => 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// Instances of this class are generated by the C# compiler.
/// </summary>
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class CSharpUnaryOperationBinder : UnaryOperationBinder, ICSharpBinder
{
[ExcludeFromCodeCoverage(Justification = "Name should not be called for this binder")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Microsoft.CSharp.RuntimeBinder.ComInterop
{
[RequiresUnreferencedCode(Binder.TrimmerWarning)]
[RequiresDynamicCode(Binder.DynamicCodeWarning)]
internal sealed class BoundDispEvent : DynamicObject
{
private readonly object _rcw;
Expand Down
Loading
Loading