Skip to content
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 build warnings and update compiler #3400

Merged
merged 4 commits into from
Mar 23, 2020
Merged

Conversation

sharwell
Copy link
Member

No description provided.

@sharwell sharwell requested a review from a team as a code owner March 19, 2020 01:15
@codecov
Copy link

codecov bot commented Mar 19, 2020

Codecov Report

Merging #3400 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master    #3400   +/-   ##
=======================================
  Coverage   95.21%   95.21%           
=======================================
  Files         993      993           
  Lines      226241   226241           
  Branches    14524    14524           
=======================================
  Hits       215426   215426           
  Misses       9186     9186           
  Partials     1629     1629

@@ -44,7 +44,7 @@ public override void Initialize(AnalysisContext analysisContext)

analysisContext.RegisterCompilationStartAction(startContext =>
{
var instantiatedTypes = new ConcurrentDictionary<INamedTypeSymbol, object?>();
ConcurrentDictionary<INamedTypeSymbol, object?> instantiatedTypes = new ConcurrentDictionary<INamedTypeSymbol, object?>();
Copy link
Member

@jcouv jcouv Mar 19, 2020

Choose a reason for hiding this comment

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

Those explicit types were not necessary, were they?

Copy link
Member

Choose a reason for hiding this comment

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

The commit introducing these changes is named "Use explicit type where compiler fails to evaluate nullability" so I think they matters.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jcouv yes, they are necessary. var doesn't work with local functions, at least not here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to file a compiler bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think there are already bugs filed for improving local function support. It hit Roslyn too.

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -66,14 +66,14 @@ public sealed override void Initialize(AnalysisContext context)
return;
}

var forwardGraph = new ConcurrentDictionary<ISymbol, ConcurrentDictionary<ISymbol, bool>>();
var invertedGraph = new ConcurrentDictionary<ISymbol, ConcurrentDictionary<ISymbol, bool>>();
ConcurrentDictionary<ISymbol, ConcurrentDictionary<ISymbol, bool>> forwardGraph = new ConcurrentDictionary<ISymbol, ConcurrentDictionary<ISymbol, bool>>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please retarget all security rule changes to 2.9.x branch. Also, there is no nullability involved here, so why was this required?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not practical to backport this change. The 2.9.x branch doesn't support this toolchain or compiler version so it would be a large backport of much more than just this pull request.

I don't believe these changes will be a problem in practice. /cc @dotpaul for awareness.

@sharwell sharwell merged commit 6dc3658 into dotnet:master Mar 23, 2020
@sharwell sharwell deleted the fix-warnings branch March 23, 2020 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants