-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Consistently return the same value from MethodSymbol.IteratorElementTypeWithAnnotations API #65291
Conversation
…ypeWithAnnotations API Fixes dotnet#40014.
@dotnet/roslyn-compiler Please review |
var local = model.GetDeclaredSymbol(declaration).GetSymbol<MethodSymbol>(); | ||
|
||
Assert.True(local.IsIterator); | ||
Assert.Equal("System.Int32", local.IteratorElementTypeWithAnnotations.ToTestDisplayString()); |
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.
nit: do we have a test for calling IteratorElementTypeWithAnnotations
on a non-iterator method (the null
case)? #Closed
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.
do we have a test for calling IteratorElementTypeWithAnnotations on a non-iterator method (the null case)?
I do not know. Is there a specific concern?
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.
Never mind, I thought it was a public API.
@@ -2366,8 +2366,22 @@ public unsafe IEnumerable<int> M4(int* a) | |||
})(); | |||
} | |||
}"; | |||
CreateCompilation(src, options: TestOptions.UnsafeDebugDll) | |||
.VerifyDiagnostics( | |||
var comp = CreateCompilation(src, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.RegularNext.WithFeature("run-nullable-analysis", "never")); |
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.
Why skip nullable analysis? #Closed
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.
Why skip nullable analysis?
Because it binds the body before we can get the symbol, which defeats the purpose of the test.
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 Thanks (iteration 2)
@dotnet/roslyn-compiler For the second review. |
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 2)
Fixes #40014.