提交 8fa387e8 编写于 作者: N Neal Gafter

Touch up the post-merge for recursive patterns.

上级 2f6f4b02
......@@ -202,6 +202,11 @@ internal override void ValidateOptions(ArrayBuilder<Diagnostic> builder)
internal bool IsFeatureEnabled(MessageID feature)
{
string featureFlag = feature.RequiredFeature();
if (featureFlag != null)
{
return Features.ContainsKey(featureFlag);
}
LanguageVersion availableVersion = LanguageVersion;
LanguageVersion requiredVersion = feature.RequiredVersion();
return availableVersion >= requiredVersion;
......
......@@ -25,11 +25,16 @@ public void DiagnosticAnalyzerAllInOne()
symbolKindsWithNoCodeBlocks.Add(SymbolKind.Property);
symbolKindsWithNoCodeBlocks.Add(SymbolKind.NamedType);
// PROTOTYPE(patterns2): Add examples of all the new pattern types once supported.
var syntaxKinds = new HashSet<SyntaxKind>();
syntaxKinds.Add(SyntaxKind.SubpatternElement);
syntaxKinds.Add(SyntaxKind.DeconstructionPattern);
var analyzer = new CSharpTrackingDiagnosticAnalyzer();
CreateCompilationWithMscorlib45(source).VerifyAnalyzerDiagnostics(new[] { analyzer });
analyzer.VerifyAllAnalyzerMembersWereCalled();
analyzer.VerifyAnalyzeSymbolCalledForAllSymbolKinds();
analyzer.VerifyAnalyzeNodeCalledForAllSyntaxKinds(new HashSet<SyntaxKind>());
analyzer.VerifyAnalyzeNodeCalledForAllSyntaxKinds(syntaxKinds);
analyzer.VerifyOnCodeBlockCalledForAllSymbolAndMethodKinds(symbolKindsWithNoCodeBlocks);
}
......
......@@ -324,8 +324,8 @@ namespace My
break;
case int i:
break;
case Type (int x, 3) { A: 5, B: 7 } identifier:
break;
// case Type (int x, 3) { A: 5, B: 7 } identifier:
// break;
default:
{
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册