Skip to content

Validate the key is in the dict#6304

Closed
Forgind wants to merge 1 commit intodotnet:mainfrom
Forgind:remove-unchecked-dict-access
Closed

Validate the key is in the dict#6304
Forgind wants to merge 1 commit intodotnet:mainfrom
Forgind:remove-unchecked-dict-access

Conversation

@Forgind
Copy link
Copy Markdown
Contributor

@Forgind Forgind commented Mar 26, 2021

Fixes potential access problem.

Copy link
Copy Markdown
Member

@rokonec rokonec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from that recommended change, which is not related to this commit, it is OK.

@Forgind Forgind force-pushed the remove-unchecked-dict-access branch from 4ae4d28 to db672fa Compare March 26, 2021 17:18
Copy link
Copy Markdown
Member

@KirillOsenkov KirillOsenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@benvillalobos
Copy link
Copy Markdown
Member

This is strictly better than the previous version, approved.

Note that this method is easy to confuse with how warnings are actually converted, which is handled in LogBuildEvent, not here. Modifying this method only modifies how tasks understand that a warning they logged would be converted to an error.

Issues arise from a task relying on Log.HasLoggedError under this case:

  1. All warnings are errors (warningsAsErrorsExcludingMessages will be a non-null empty set)
  2. There are any warningsAsMessages for this particular project.

Result: This method returns null, which implies that there are no warnings as errors. No task will see that a warning it logged was treated as an error. While this isn't great, it's the same functionality as what came before it. The workaround for this would be to manually select warnings to be errors. I'll file a bug on it.

@benvillalobos benvillalobos added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Mar 26, 2021
@Forgind Forgind closed this Mar 31, 2021
@Forgind Forgind deleted the remove-unchecked-dict-access branch March 31, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants