Repository navigation
generic type annotation - #2478
Conversation
vitek-karas
left a comment
There was a problem hiding this comment.
LGTM - but please wait for Sven or Andy to take another look as well.
The testing problem can be solved - we could modify our validator to ignore warnings from within test attributes (assuming there's a reasonable way to detect them). I just checked and Roslyn does raise warnings for generic constraints even inside nameof: So it would be good to follow suite I guess. In general I still think that analyzer should not report warnings which the linker doesn't - mainly because if there's a warning which we think the analyzer SHOULD report and the linker doesn't -> it's almost certainly a bug in the linker. |
|
I'd be fine generating a warning here, just because it seems like it might be simpler to implement and understand. |
|
I agree this is a grey area but fall on the side of (slightly) preferring not to warn. My reasoning is that this warning will cause developer confusion (its not intuitive to anyone that a compiler enhancement used to generate a string will have trimming implications) and cost time with the warning for no real benefit. After the developer understands the warning, I believe they will almost always result in taking no positive action but workarounds (as in use the literal string for example) circumventing the good programming practice Given the views expressed above for generating warning are not strong, I will go with the no-warn option |
|
To be clear, I'm fine either way 😄 |
* generic type annotation - take 1 * fb * FB2 * Using Syntax API and refactored GenericParameterDataFlow test into 2 * incorprate FB * fix remaining issues * CI build break fix * FB * FB * FB * enhanced comments Commit migrated from dotnet/linker@56421a1
Initial effort for #2364.
Using Syntax API and refactored
GenericParameterDataFlowtest into 2 testsSwitched to registering
RegisterSyntaxNodeActionto processINamedTypeSymbolandIMethodSymbolfor processing generic parameter warnings. Also refactored theGenericParameterDataFlowby keeping test scenarios that handleMakeGenericXXX(that is awaiting Intrinsics) in the original test and the rest of test scenarios toGenericParameterDataFlowWithoutMakeGenericand enabled that test inDataFlowTests.Some comments on exceptions,