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

Explicitly filter down to constructible types before offering fixes #69542

Merged
merged 5 commits into from
Aug 16, 2023

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner August 16, 2023 15:25
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 16, 2023
@CyrusNajmabadi CyrusNajmabadi merged commit 3ffcdc4 into dotnet:main Aug 16, 2023
23 of 24 checks passed
@ghost ghost added this to the Next milestone Aug 16, 2023
IMethodSymbol? GetAccessibleInstanceConstructor(ImmutableArray<IMethodSymbol> constructors, Func<IMethodSymbol, bool> predicate)
{
var constructor = constructors.FirstOrDefault(c => !c.IsStatic && predicate(c));
return constructor is not null && constructor.IsAccessibleWithin(compilation.Assembly) ? constructor : null;
Copy link
Member

Choose a reason for hiding this comment

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

❔ I can't find a specific location where abstract types are disallowed. In most cases, the parameterless constructor of an abstract type would not be accessible, but there are specific cases where it is (e.g. if you are currently in the implementation of a derived type, or if the constructor has been explicitly declared public).

@CyrusNajmabadi CyrusNajmabadi deleted the constructibleTypes branch August 16, 2023 19:31
@dibarbet dibarbet modified the milestones: Next, 17.8 P2 Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants