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

Correct IsImplicitlyDeclared for SimpleProgramNamedTypeSymbol #48176

Closed
wants to merge 1 commit into from

Conversation

Youssef1313
Copy link
Member

The class documentation clearly states:

    /// <summary>
    /// Represents implicitly declared type for a Simple Program feature.
    /// </summary>

Fixes #48171

@Youssef1313 Youssef1313 requested a review from a team as a code owner September 29, 2020 23:05
@CyrusNajmabadi
Copy link
Member

Needs tests :)

@@ -220,7 +220,7 @@ protected override MembersAndInitializers BuildMembersAndInitializers(Diagnostic
instanceInitializersSyntaxLength: 0);
}

public override bool IsImplicitlyDeclared => false;
public override bool IsImplicitlyDeclared => true;
Copy link
Contributor

Choose a reason for hiding this comment

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

public override bool IsImplicitlyDeclared => true; [](start = 8, length = 50)

This is not a change that we would like to make. Please revert

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

This isn't a change that we would want to make.

@AlekseyTs
Copy link
Contributor

@Youssef1313 In the future, especially for bugs that require changes in compilers, please make sure that:

  • the problem in the bug has been stated in compiler terms (i.e. some API returns unexpected value, etc)
  • the bug has been triaged and that we confirmed that we would like to make the suggested change

@AlekseyTs AlekseyTs closed this Sep 30, 2020
@Youssef1313
Copy link
Member Author

This isn't a change that we would want to make.

Can you clarify why?

I can't see why the change is wrong. The documentation for IsImplicitlyDeclared states:

Returns true if this symbol was automatically created by the compiler, and does not have an explicit corresponding source code declaration.

And that's the case with the symbol <Program>$ (i.e. SimpleProgramNamedTypeSymbol). It is automatically created by the compiler and it's indeed doesn't have an explicit source code declaration.

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.

Analyzer leaks the compiler generated class name for top-level statements
3 participants