Fix GetSymbolInfo on ValueTuple declaration#43467
Conversation
|
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.
NameofFixedBuffer [](start = 20, length = 17)
Is this test added to cover changes in MethodCompiler?
There was a problem hiding this comment.
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.
This scenarios are not interesting (were not requested) because they are not using target typed new #Closed
There was a problem hiding this comment.
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.
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.
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.
* 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