-
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
Fix GetSymbolInfo on ValueTuple declaration #43467
Conversation
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 (iteration 1)
It looks like there several more places in the code base where we perform a type check against SourceMemberFieldSymbol or a type derived from it. Please review them to make sure they do not need to be adjusted with respect to tuple fields. #Closed |
I found one. Thanks I also realized I forgot to add a target-type new test you had suggested (here). Didn't seem worth a dedicated PR so snuck it here. |
} | ||
|
||
[Fact, WorkItem(1090920, "https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1090920")] | ||
public void NameofFixedBuffer() |
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.
NameofFixedBuffer [](start = 20, length = 17)
Is this test added to cover changes in MethodCompiler?
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.
Yes, it covers the handling in if (fieldSymbol.IsFixedSizeBuffer && compilationState.Emitting)
that is now reachable.
{ | ||
new C(new()); | ||
new C(default); | ||
new C(null); |
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.
This scenarios are not interesting (were not requested) because they are not using target typed new #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.
Ah, duh! My bad
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 reacted too quickly. This test is testing target-typed new (first scenario) and comparing with default
and null
behavior with regards to use-site diagnostics.
I can also test C c = new(null);
which will be ambiguous. Is that what you had in mind?
{ | ||
public void M2(C c) | ||
{ | ||
new C(new()); |
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.
new C [](start = 8, length = 5)
This is also not quite the scenario, the errors are not reported due to target typed new. We want the target typed new to be the only source of errors. Here we are mixing too much together. #Closed
new C(new()); | ||
new C(default); | ||
new C(null); | ||
C c = new(null); |
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.
C c = new(null); [](start = 8, length = 16)
Please add a test for a target typed new as an argument of a call that would assert use-site errors caused by the target typed new.
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 (iteration 7)
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.
* upstream/master: (1099 commits) Specially handle tuple methods in CodeGenerator.EmitMethodInfoExpression for VB. (dotnet#43553) Remove unnecessary usings AssetStorage cleanup (dotnet#43511) Remove unused code (dotnet#43556) Revert anonymous type DebuggerDisplay change (dotnet#43575) Replace GeneratePkgDef with impl that does not load assemblies (dotnet#43302) Fix Update src/Analyzers/Core/CodeFixes/MakeFieldReadonly/AbstractMakeFieldReadonlyCodeFixProvider.cs PR feedback use capacity when creating builders. Push options down. Rename methods Fix GetSymbolInfo on ValueTuple declaration (dotnet#43467) Add support for cref-type-parameters. Support OOP with dynamic types. Support error locals in symbolkey Update tests to run OOP Update docs/Language Feature Status.md Update for partial methods Fix typos (dotnet#43494) ...
Fixes https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1090920