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

Fix NullReferenceException when using write-only indexer with VerifySet #1037

Merged
merged 3 commits into from
Jun 30, 2020

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Jun 30, 2020

Fixes #1036.

@stakx stakx marked this pull request as draft June 30, 2020 21:49
stakx added 2 commits July 1, 2020 00:18
The expression splitting logic is a little hacky when it comes to
assignments to property or indexer setters: first, a split operation
is performed as if we were looking at a property or indexer *getter*;
the `InvocationShape` receives the correct method, but is one argument
short. Once that first `InvocationShape` has been built, we can create
a second, patched and fully correct version that includes the assign-
ment (RHS) argument.

This commit relaxes validation rules for the first `InvocationShape`
(i.e. the one with the potential argument count mismatch).
@stakx stakx force-pushed the write-only-indexer-assignment branch from 4209825 to f32a129 Compare June 30, 2020 22:20
@stakx stakx marked this pull request as ready for review June 30, 2020 22:25
@stakx stakx merged commit 8af868a into master Jun 30, 2020
@stakx stakx deleted the write-only-indexer-assignment branch June 30, 2020 22:26
@stakx stakx added this to the 4.14.5 milestone Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VerifySet breaks with System.NullReferenceException for WriteOnly-Indexed-Properties
1 participant