-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add new ConversionKind to IsImplicitConversion test #35095
Add new ConversionKind to IsImplicitConversion test #35095
Conversation
Is there a place I can add tests? Just adding this code to our CodeAction tests didn't trigger the bug, but likely somewhere in the compiler layer there's a good place to add one. |
@ryzngard For testing, based on what I can see in the issue (stack trace), you need to get the conversion that is causing problems (likely from a semantic model call) and check In terms of where to add the new compiler test(s), I see that |
Marked PR as "private" for now. Please ping if you have any other questions, or once ready for review after test is added. Thanks |
@jcouv test added to cover this bug, should be ready for review |
src/Compilers/CSharp/Test/Symbol/Compilation/GetSemanticInfoTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Symbol/Compilation/GetSemanticInfoTests.cs
Outdated
Show resolved
Hide resolved
var foreachSyntaxNode = root.DescendantNodes().OfType<ForEachStatementSyntax>().Single(); | ||
var foreachSymbolInfo = model.GetForEachStatementInfo(foreachSyntaxNode); | ||
|
||
Assert.Equal(Conversion.UnsetConversion, foreachSymbolInfo.CurrentConversion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to continue with this PR as is to fix the crash. I've filed #35918 to track a deeper fix if needed.
@jcouv @RikkiGibson please take another look at this. I've opened a separate issue for the open concern #35918 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 5)
@ryzngard The compiler team requires two reviews before merging. Generally speaking you should let each team merge reviews for code maintained by that team. Hopefully @jcouv will be able to look at this on Tuesday. I am not going to revert this, but it is possible there will be more work on the basis of his review. |
@gafter my apologies. I'll remember that for the future. |
Fixes #34984
UnsetConversionKind
was added by this commit but the switch statement wasn't updated.