Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsPattern breaking inside of IfStatement #130

Closed
belav opened this issue Apr 20, 2021 · 1 comment · Fixed by #155
Closed

IsPattern breaking inside of IfStatement #130

belav opened this issue Apr 20, 2021 · 1 comment · Fixed by #155
Assignees
Labels
area:formatting type:bug Something isn't working
Milestone

Comments

@belav
Copy link
Owner

belav commented Apr 20, 2021

This if statement breaks in a rather weird way.

        if (
            Nullable.GetUnderlyingType111111111111111(
                typeof(T)
            ) is Type innerType &&
            innerType.IsEnum
        ) {
            return;
        }
@belav belav added type:bug Something isn't working area:formatting labels Apr 20, 2021
@belav
Copy link
Owner Author

belav commented Apr 20, 2021

This also is breaking weird now.
This was a result of #152 but is working now

// used to break like this
                if (
                    oldValueType != newValueType // Definitely different
                    || !IsKnownImmutableType(oldValueType) // Maybe different
                    || !oldValue.Equals(newValue)
                ) // Somebody says they are different
                 {
                     return true;
                 }
// now breaks like
                if (
                    oldValueType !=
                    newValueType // Definitely different
                    ||
                    !IsKnownImmutableType(
                        oldValueType
                    ) // Maybe different
                    ||
                    !oldValue.Equals(newValue)
                ) // Somebody says they are different
                {
                    return true;
                }

@belav belav modified the milestones: Alpha2, Alpha3 Apr 20, 2021
@belav belav self-assigned this Apr 26, 2021
@belav belav changed the title IfStatement breaking IsPattern breaking inside of IfStatement Apr 26, 2021
belav added a commit that referenced this issue Apr 26, 2021
belav added a commit that referenced this issue May 1, 2021
@belav belav closed this as completed in #155 May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:formatting type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant