Skip to content

Fix regression in recursive patterns#55208

Merged
jcouv merged 2 commits intodotnet:release/dev17.0from
jcouv:patterns-fix
Jul 29, 2021
Merged

Fix regression in recursive patterns#55208
jcouv merged 2 commits intodotnet:release/dev17.0from
jcouv:patterns-fix

Conversation

@jcouv
Copy link
Copy Markdown
Member

@jcouv jcouv commented Jul 29, 2021

Looking back at the change in MakeTestsAndBindingsForRecursivePattern for the extended property patterns, I see that the behavior in error case changed a bit. It used to bail, avoiding continuing to MakeTestsAndBindings. This PR restores that behavior.

Although we do have some tests for error cases (such as ExtendedPropertyPatterns_BadMemberAccess) they happen to use patterns that are compatible with the original input type, so didn't hit this crash.

Fixes #55184

@jcouv jcouv added this to the 17.0.P3 milestone Jul 29, 2021
@jcouv jcouv self-assigned this Jul 29, 2021
@jcouv jcouv marked this pull request as ready for review July 29, 2021 05:16
@jcouv jcouv requested a review from a team as a code owner July 29, 2021 05:16
{
Debug.Assert(recursive.HasAnyErrors);
tests.Add(new Tests.One(new BoundDagTypeTest(recursive.Syntax, ErrorType(), input, hasErrors: true)));
continue;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seems like continue skips just a single statement here so 'else' may be preferable

@jcouv jcouv enabled auto-merge (squash) July 29, 2021 18:52
@jcouv jcouv merged commit 5177a82 into dotnet:release/dev17.0 Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants