-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The most important change is to make warning codes and messages unique - that is for each code there's exactly one message. This means adding quite a few new codes as we were sharing them rather heavily. We also try to avoid logic when constructing messages (to allow for better localization), so instead of having smaller pieces concatenated we introduce several similar warnings. This change also adds more tests for some of the warnings. Infra changes: * Add the warning code parameter to unrecognized reflection call on the interface * Add a new ExpectedWarning test attribute which validates the code, the location and optionally parts of the message * Improved the unrecognized reflection pattern attribute to accept only parts of the message (and to accept more than one) * Add the ability to validat the warning code for unrecognised reflection patterns * Refactor source context for annotated values Makes the source context required by making it a a .ctor argument for all annotated nodes. Make it IMetadataTokenProvider. Fixes the problem with AnnotatedStringValue which was reported as "unknown" in warning messages. This also slightly changes what is stored in the SourceContext - now it's the actual thing (so ParameterDefinition, MethodReturnType and so on) - so printing it out doesn't require knowing which value node it came from. This is cleaner because the SourceContext describes where the value came from, not what the value is (that's the job of the ValueNode). In warnings we typically don't want to print out what the value is since in most cases we don't know the actual value (we just know things about it), so we can rely on SourceContext to simplify some code. Co-authored-by: Sven Boemer <[email protected]>
- Loading branch information
1 parent
fc5e4aa
commit 2b04c06
Showing
88 changed files
with
2,905 additions
and
913 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.