@@ -25,7 +25,7 @@ public abstract class LambdaExpression : Expression, IParameterProvider
25
25
26
26
private readonly Expression _body ;
27
27
28
- // This can be flipped to false using feature switches at publishing time
28
+ [ FeatureGuard ( typeof ( RequiresDynamicCodeAttribute ) ) ]
29
29
public static bool CanCompileToIL => RuntimeFeature . IsDynamicCodeSupported ;
30
30
31
31
// This could be flipped to false using feature switches at publishing time
@@ -138,10 +138,7 @@ public Delegate Compile()
138
138
{
139
139
if ( CanCompileToIL )
140
140
{
141
- #pragma warning disable IL3050
142
- // Analyzer doesn't yet understand feature switches
143
141
return Compiler . LambdaCompiler . Compile ( this ) ;
144
- #pragma warning restore IL3050
145
142
}
146
143
else
147
144
{
@@ -221,10 +218,7 @@ internal Expression(Expression body)
221
218
{
222
219
if ( CanCompileToIL )
223
220
{
224
- #pragma warning disable IL3050
225
- // Analyzer doesn't yet understand feature switches
226
221
return ( TDelegate ) ( object ) Compiler . LambdaCompiler . Compile ( this ) ;
227
- #pragma warning restore IL3050
228
222
}
229
223
else
230
224
{
@@ -629,10 +623,7 @@ internal static LambdaExpression CreateLambda(Type delegateType, Expression body
629
623
MethodInfo create ;
630
624
if ( LambdaExpression . CanCompileToIL )
631
625
{
632
- #pragma warning disable IL3050
633
- // Analyzer doesn't yet understand feature switches
634
626
create = typeof ( Expression < > ) . MakeGenericType ( delegateType ) . GetMethod ( "Create" , BindingFlags . Static | BindingFlags . NonPublic ) ! ;
635
- #pragma warning restore IL3050
636
627
}
637
628
else
638
629
{
0 commit comments