Mapster
Mapster copied to clipboard
FEC 4.2.2 Error
I upgraded fec 4.2.2 (https://github.com/dadhi/FastExpressionCompiler/releases/tag/v4.2.2) and Compile throws exception.
config.NewConfig<SubscriptionReport, SubscriptionReportOutputDTO>()
.Map(dest => dest.Email,
src => src.User.Email)
.Map(dest => dest.PackageName,
src => src.PackageName)
.Map(dest => dest.CreatedAt,
src => src.CreatedAt)
.Map(dest => dest.PaidAmount,
src => src.PaidAmount)
.Map(dest => dest.Action,
src => src.Action);
config.Compiler = exp => exp.CompileFast();
===>>>(this line) config.Compile();
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at FastExpressionCompiler.ExpressionCompiler.NestedLambdaInfo.GetLambdaType() in /_/src/FastExpressionCompiler/FastExpressionCompiler.cs:line 592
at FastExpressionCompiler.ExpressionCompiler.EmittingVisitor.EmitLoadConstantsAndNestedLambdasIntoVars(ILGenerator il, ClosureInfo& closure) in /_/src/FastExpressionCompiler/FastExpressionCompiler.cs:line 3436
at FastExpressionCompiler.ExpressionCompiler.TryCompileBoundToFirstClosureParam(Type delegateType, Expression bodyExpr, IReadOnlyList`1 paramExprs, Type[] closurePlusParamTypes, Type returnType, CompilerFlags flags) in /_/src/FastExpressionCompiler/FastExpressionCompiler.cs:line 503
at FastExpressionCompiler.ExpressionCompiler.CompileFast(LambdaExpression lambdaExpr, Boolean ifFastFailedReturnNull, CompilerFlags flags) in /_/src/FastExpressionCompiler/FastExpressionCompiler.cs:line 163
at ParadiseProject.Api.MappingConfiguration.<>c.<Generate>b__0_134(LambdaExpression exp) in /app/src/ParadiseProject.Api/MappingConfiguration.cs:line 232
at Mapster.TypeAdapterConfig.Compile(Boolean failFast)
at ParadiseProject.Api.MappingConfiguration.Generate() in /app/src/ParadiseProject.Api/MappingConfiguration.cs:line 233
at Program.<>c__DisplayClass0_0.<<Main>$>g__ConfigureMapper|1() in /app/src/ParadiseProject.Api/Program.cs:line 88
at Program.<Main>$(String[] args) in /app/src/ParadiseProject.Api/Program.cs:line 34
at Program.<Main>(String[] args)
Aborted (core dumped)