Skip to content

Unexpected type change when parsing addition of integer to enum #969

Description

@glopesdev

Consider the following expression:

DayOfWeek.Monday + 1

Following #953 this expression now succeeds, but unexpectedly the type of the result is evaluated as int, rather than DayOfWeek.

Running the following expression in C# code (or C# interactive):

var day = DayOfWeek.Monday + 1

returns DayOfWeek as the type for variable day, rather than the integer backing type.

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions