-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Parse parameter list on an interface in error recovery mode #66940
Parse parameter list on an interface in error recovery mode #66940
Conversation
This also includes the following public API changes: - TypeDeclarationSyntax.ParameterList becomes abstract - TypeDeclarationSyntax.WithParameterList is added - TypeDeclarationSyntax.AddParameterListParameters is added - InterfaceDeclarationSyntax.ParameterList is added as an override - InterfaceDeclarationSyntax.WithParameterList is added - InterfaceDeclarationSyntax.AddParameterListParameters is added - new overload of InterfaceDeclarationSyntax.Update is added - new overload of SyntaxFactory.InterfaceDeclaration is added - ClassDeclarationSyntax.ParameterList is changed to an override - StructDeclarationSyntax.ParameterList is changed to an override - RecordDeclarationSyntax.ParameterList is changed to an override. This API was previousli shipped as a regular property.
MessageID.IDS_FeaturePrimaryConstructors.CheckFeatureAvailability(diagnostics, node.ParameterList); | ||
if (node.Kind() is SyntaxKind.InterfaceDeclaration) | ||
{ | ||
diagnostics.Add(ErrorCode.ERR_UnexpectedParameterList, node.ParameterList.GetLocation()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. glad this is not in the parser. #Resolved
@@ -2,6 +2,9 @@ | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
// See the LICENSE file in the project root for more information. | |||
|
|||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why add nullable disable? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why add nullable disable?
Nullable analysis has zero value in tests. And adds an extra const of suppressing warnings.
src/EditorFeatures/CSharp/CompleteStatement/CompleteStatementCommandHandler.cs
Show resolved
Hide resolved
src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs
Show resolved
Hide resolved
Are these API changes based on #66914? In that issue, |
// (1,12): error CS8803: Top-level statements must precede namespace and type declarations. | ||
// interface P(int x, int y); | ||
Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "(int x, int y);").WithLocation(1, 12)); | ||
tree.GetDiagnostics().Verify(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue reflects the state of the API before this PR. This PR is an attempt to follow-up on feedback that was provided during its review. |
This also includes the following public API changes: