提交 7bdf1ac8 编写于 作者: N Neal Gafter 提交者: GitHub

Merge pull request #13235 from gafter/master-13203

Turn on /features:strict for all projects
......@@ -212,6 +212,7 @@
<DeployToSamplesSubfolder Condition="'$(DeployToSamplesSubfolder)' == ''">false</DeployToSamplesSubfolder>
<FileAlignment>512</FileAlignment>
<HighEntropyVA>true</HighEntropyVA>
<Features>strict</Features>
</PropertyGroup>
<!--
......
......@@ -364,6 +364,10 @@ public SyntaxAndDeclarationManager RemoveSyntaxTrees(HashSet<SyntaxTree> trees)
Debug.Assert(!oldLoadDirectives.IsEmpty);
GetRemoveSetForLoadedTrees(oldLoadDirectives, loadDirectiveMap, loadedSyntaxTreeMap, removeSet);
}
else
{
oldLoadDirectives = ImmutableArray<LoadDirective>.Empty;
}
removeSet.Add(oldTree);
totalReferencedTreeCount = removeSet.Count;
......
......@@ -405,7 +405,7 @@ private static SyntaxToken GetFirstExcludedToken(StatementSyntax statement)
LocalFunctionStatementSyntax localFunctionStmt = (LocalFunctionStatementSyntax)statement;
if (localFunctionStmt.Body != null)
return GetFirstExcludedToken(localFunctionStmt.Body);
if (localFunctionStmt.SemicolonToken != null)
if (localFunctionStmt.SemicolonToken != default(SyntaxToken))
return localFunctionStmt.SemicolonToken;
return localFunctionStmt.ParameterList.GetLastToken();
default:
......
......@@ -63,6 +63,8 @@ public ResolvedReference(int index, MetadataImageKind kind)
Debug.Assert(index >= 0);
_index = index + 1;
_kind = kind;
_aliasesOpt = default(ImmutableArray<string>);
_recursiveAliasesOpt = default(ImmutableArray<string>);
}
// initialized aliases
......
......@@ -573,8 +573,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Friend Class OverrideHidingHelper(Of TSymbol As Symbol)
Inherits OverrideHidingHelper
' Comparer for comparing signatures of TSymbols in a runtime-equivalent way
Private Shared ReadOnly s_runtimeSignatureComparer As IEqualityComparer(Of TSymbol)
' Comparer for comparing signatures of TSymbols in a runtime-equivalent way.
' It is not ReadOnly because it is initialized by a Shared Sub New of another instance of this class.
Private Shared s_runtimeSignatureComparer As IEqualityComparer(Of TSymbol)
' Initialize the various kinds of comparers.
Shared Sub New()
......
......@@ -587,7 +587,7 @@ public SelectionTracking(OpenTextBufferManager openTextBufferManager)
// GetSpanInView() can return an empty collection if the tracking span isn't mapped to anything
// in the current view, specifically a `@model SomeModelClass` directive in a Razor file.
var ss = textView.GetSpanInView(kvp.Value.TrackingSpan.GetSpan(snapshot)).FirstOrDefault();
if (ss != null && (ss.IntersectsWith(selection.ActivePoint.Position) || ss.IntersectsWith(selection.AnchorPoint.Position)))
if (ss != default(SnapshotSpan) && (ss.IntersectsWith(selection.ActivePoint.Position) || ss.IntersectsWith(selection.AnchorPoint.Position)))
{
return Tuple.Create(kvp.Key, ss);
}
......
......@@ -49,6 +49,7 @@ internal abstract class EvaluationContextBase
internal string GetErrorMessageAndMissingAssemblyIdentities(DiagnosticBag diagnostics, DiagnosticFormatter formatter, CultureInfo preferredUICulture, AssemblyIdentity linqLibrary, out bool useReferencedModulesOnly, out ImmutableArray<AssemblyIdentity> missingAssemblyIdentities)
{
var errors = diagnostics.AsEnumerable().Where(d => d.Severity == DiagnosticSeverity.Error);
missingAssemblyIdentities = default(ImmutableArray<AssemblyIdentity>);
foreach (var error in errors)
{
missingAssemblyIdentities = this.GetMissingAssemblyIdentities(error, linqLibrary);
......
......@@ -37,6 +37,7 @@ public DocumentAnalysisData(VersionStamp version, ImmutableArray<DiagnosticData>
{
this.Version = version;
this.Items = items;
this.OldItems = default(ImmutableArray<DiagnosticData>);
}
public DocumentAnalysisData(VersionStamp version, ImmutableArray<DiagnosticData> oldItems, ImmutableArray<DiagnosticData> newItems) :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册