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

Don't report modifier errors while parsing. #16339

Merged
merged 24 commits into from
Jul 17, 2017

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi force-pushed the parserDiagnostics29 branch 3 times, most recently from c468b3d to e82cbb4 Compare January 8, 2017 19:55
@CyrusNajmabadi
Copy link
Member Author

Note: this PR depends on #16338 which shoudl be reviewed first.

@CyrusNajmabadi
Copy link
Member Author

I also recommend reviewing #16341 first.

@agocke agocke changed the base branch from post-dev15 to master February 14, 2017 23:28
@gafter gafter self-assigned this Apr 14, 2017
Copy link
Member

@gafter gafter left a comment

Choose a reason for hiding this comment

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

LGTM, except possible for the one comment.

@@ -40,17 +40,19 @@ internal sealed class LocalFunctionSymbol : MethodSymbol
_syntax = syntax;
_containingSymbol = containingSymbol;

var diagnostics = DiagnosticBag.GetInstance();
Copy link
Member

@gafter gafter Apr 14, 2017

Choose a reason for hiding this comment

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

I think this new variable is unused? #Resolved

Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Apr 15, 2017

Choose a reason for hiding this comment

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

You are correct. Removing. #Resolved

@gafter gafter removed their assignment Apr 14, 2017
@CyrusNajmabadi
Copy link
Member Author

@ManishJayaswal

Customer scenario

None. This is general infrastructure work for the compiler based on design changes the team agreed on.

Bugs this fixes:

N/A

Workarounds, if any

N/A

Risk

Low.

Performance impact

Low.

Is this a regression from a previous update?

N/A

Root cause analysis:

N/A.

How was the bug found?

N/A

1 similar comment
@CyrusNajmabadi
Copy link
Member Author

@ManishJayaswal

Customer scenario

None. This is general infrastructure work for the compiler based on design changes the team agreed on.

Bugs this fixes:

N/A

Workarounds, if any

N/A

Risk

Low.

Performance impact

Low.

Is this a regression from a previous update?

N/A

Root cause analysis:

N/A.

How was the bug found?

N/A

@CyrusNajmabadi
Copy link
Member Author

Tagging @MattGertz Improvements in parser that benefit IDE and compiler.

@MattGertz
Copy link
Contributor

Approved pending tests.

@CyrusNajmabadi
Copy link
Member Author

retest this please

@jaredpar jaredpar modified the milestone: 15.later Apr 26, 2017
@CyrusNajmabadi CyrusNajmabadi changed the base branch from master to dev15.6 May 17, 2017 20:51
@CyrusNajmabadi
Copy link
Member Author

Rebased to 15.6

@jasonmalinowski jasonmalinowski changed the base branch from dev15.6 to master June 29, 2017 22:09
@jasonmalinowski
Copy link
Member

@CyrusNajmabadi This branch is fairly stale, should it still be active?

@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski Yes it should. I'm still waiting on a second compiler review. @jcouv could you look when you have a chance?

@@ -529,7 +529,7 @@ internal enum ErrorCode
ERR_PartialMethodInvalidModifier = 750,
ERR_PartialMethodOnlyInPartialClass = 751,
ERR_PartialMethodCannotHaveOutParameters = 752,
ERR_PartialMethodOnlyMethods = 753,
// ERR_PartialMethodOnlyMethods = 753, Removed as it is subsumed by ERR_PartialMisplaced
Copy link
Member

@jcouv jcouv Jul 17, 2017

Choose a reason for hiding this comment

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

ERR_PartialMethodOnlyMethods [](start = 11, length = 28)

Did you remove the corresponding resource string? #Resolved

Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Jul 17, 2017

Choose a reason for hiding this comment

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

#fixed #Resolved

{
var result = DeclarationModifiers.None;

bool seenNoDuplicates = true;
Copy link
Member

@jcouv jcouv Jul 17, 2017

Choose a reason for hiding this comment

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

Consider naming those positively (seenDuplicates, seenAccessibilityDuplicates). #Resolved

Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Jul 17, 2017

Choose a reason for hiding this comment

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

I'm preserving the logic as it was in ParseModifiers. I think that makes the review a bit easier. #Resolved

@@ -44,7 +45,8 @@ internal static class ModifierUtils
switch (oneError)
{
case DeclarationModifiers.Partial:
diagnostics.Add(ErrorCode.ERR_PartialMethodOnlyMethods, errorLocation);
// Errors about 'partial' are reported in ToDeclarationModifiers. So no need to report
Copy link
Member

Choose a reason for hiding this comment

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

The comment is not quite right. There is one path that calls CheckModifiers directly. See SourceMemberContainerSymbol.cs MakeAndCheckTypeModifiers.

Copy link
Member Author

Choose a reason for hiding this comment

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

True. Let me investigate. We may have a test hole here.

Diagnostic(ErrorCode.ERR_SemicolonExpected, "partial").WithLocation(6, 13),
// (6,13): error CS0102: The type 'PartialPartial' already contains a definition for ''
// partial partial void PM()
Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "").WithArguments("PartialPartial", "").WithLocation(6, 13),
Copy link
Member

@jcouv jcouv Jul 17, 2017

Choose a reason for hiding this comment

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

The empty string seems strange. Is that intended?
Please file issue if this is the one you meant by "not great".

Copy link
Member Author

Choose a reason for hiding this comment

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

will do.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM

@CyrusNajmabadi CyrusNajmabadi merged commit 001294b into dotnet:master Jul 17, 2017
@CyrusNajmabadi CyrusNajmabadi deleted the parserDiagnostics29 branch July 17, 2017 23:38
333fred added a commit to 333fred/roslyn that referenced this pull request Jul 20, 2017
…c-member-reference

* dotnet/features/ioperation: (134 commits)
  Fix build break in IOperation feature branch
  Fix unit tests that broke with previous commit
  Address PR feedback from Chuck
  Fix unit test
  Add IOperation support for variations of object creation expressions (type parameter, nopia and dynamic)
  Remove dead code from GenerateConstructor.
  Disable NETCore version check
  Fixed review notes.
  Add comment
  Disable NETCore version check
  Show modifier/method/type block declaration keywords after attribute lists
  Improve type argument list parsing in error conditions. (dotnet#19467)
  Don't report modifier errors while parsing. (dotnet#16339)
  Fix assert and merge
  Remove extra space
  Restore failure behavior.
  Simplify implementation of parsing constraints. (dotnet#16429)
  Fix csproj
  Remove CapturedVariablesByLambda (dotnet#20878)
  Remove testing wait
  ...
@jcouv jcouv modified the milestones: 15.later, 15.5 Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants