Skip to content

Parsing error adding numeric constant to enum value #951

@glopesdev

Description

@glopesdev

Consider the following expression:

DayOfWeek.Monday + 1

This unexpectedly throws:

System.InvalidOperationException:
'No coercion operator is defined between types 'System.DayOfWeek' and 'System.Nullable`1[System.Decimal]'.'

The same happens if we pass DayOfWeek as it and use the simpler expression: it + 1.

Note this is perfectly legitimate C# syntax and semantics, and I have also tested this operation works well in the original Dynamic LINQ library.

From the exception message it seems there is some unhandled edge case, but no idea yet of how it comes to involve nullable types.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions