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 #1049 by adding a workaround (until Roslyn issue is fixed) #1059

Closed

Conversation

TymurGubayev
Copy link
Contributor

#1049

Problem

In some circumstances, VisualBasicDataFlowAnalysis.get_ReadInside throws the first time it's called, but works the 2nd time around.

Solution

  • replace methodFlow.ReadInside with methodFlow.ReadInsideSafe() a new extension method that just tries to read the property a 2nd time in case of any exception.
  • Which part of this PR is most in need of attention/improvement? The test doesn't work atm because of another problem.
  • At least one test covering the code changed

@TymurGubayev
Copy link
Contributor Author

There is a problem with the tests I don't know the proper solution for:

@GrahamTheCoder
Copy link
Member

Interesting there was a patch for something like that which should be in 4.8, but the issue was never closed: dotnet/roslyn#63921

@GrahamTheCoder
Copy link
Member

GrahamTheCoder commented Dec 10, 2023

Many thanks for the fix and attempt to add a test. I think we're penned in by upstream bugs, so in this instance I've cherry picked just your implementation onto master since it seems hard to believe it'll make anything worse, and isn't exactly a huge maintenance burden. I'll close this PR as complete

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.

2 participants