Skip to content

Commit

Permalink
Fix bitrot in System.Linq.Expressions (dotnet#38438)
Browse files Browse the repository at this point in the history
System.Linq.Expressions is not getting compiled without FEATURE_COMPILE so it started rotting.

* Nullable annotations
* Fix break introduced in dotnet#32768
  • Loading branch information
MichalStrehovsky authored Jun 26, 2020
1 parent ed78fad commit a87ebc5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ internal static Expression<TDelegate> Create(Expression body, string? name, bool
// Separate expression creation class to hide the CreateExpressionFunc function from users reflecting on Expression<T>
public class ExpressionCreator<TDelegate>
{
public static LambdaExpression CreateExpressionFunc(Expression body, string name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
public static Expression<TDelegate> CreateExpressionFunc(Expression body, string? name, bool tailCall, ReadOnlyCollection<ParameterExpression> parameters)
{
if (name == null && !tailCall)
{
Expand Down Expand Up @@ -598,7 +598,7 @@ internal static LambdaExpression CreateLambda(Type delegateType, Expression body
#if FEATURE_COMPILE
MethodInfo create = typeof(Expression<>).MakeGenericType(delegateType).GetMethod("Create", BindingFlags.Static | BindingFlags.NonPublic)!;
#else
MethodInfo create = typeof(ExpressionCreator<>).MakeGenericType(delegateType).GetMethod("CreateExpressionFunc", BindingFlags.Static | BindingFlags.Public);
MethodInfo create = typeof(ExpressionCreator<>).MakeGenericType(delegateType).GetMethod("CreateExpressionFunc", BindingFlags.Static | BindingFlags.Public)!;
#endif
if (delegateType.IsCollectible)
{
Expand Down

0 comments on commit a87ebc5

Please sign in to comment.