Skip to content

Lambda variable identifier treated as an unknown identifier #606

Open
@BardezAnAvatar

Description

I've an interesting scenario that is driving me nuts:

I have a model that I am registering to RulesEngine via parameter (line) that consists of:
IReadOnlyList<string> Modifiers { get; }

Any expression that accesses this (in a .NET 6 project/solution) is encountering the following:

Exception while parsing expression `line.Modifiers.Any(l => new [] {"25"}.Contains(l))` - Unknown identifier 'l'

Oddly, in a separate solution that generates this expression, I am able to load the above without issue in my integration test project. Taking the same expression over to my other solution, however, yields the above exception when running RulesEngine. Both solutions use the exact same NuGet version of RulesEngine (5.0.3), using the same Workflow serialization/deserialization.

With tinkering, it seems that the specific reference of l that is a problem is on the left-hand side of the lambda, not the .Contains(l) statement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions