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

unreachable_from_main: Report unreachable constructors #4162

Merged
merged 2 commits into from
Mar 29, 2023

Conversation

srawlins
Copy link
Member

Description

This adds support for reporting unreachable constructors in unreachable_from_main.

  • Constructors (named and unnamed) can be reachable through direct call, tear-off, explicit super call, implicit super call (default constructor), transitive implicit super call, redirecting constructor initializer, redirected factory constructor.
  • Unused public enum constructors are already reported as UNUSED_ELEMENT.

@coveralls
Copy link

coveralls commented Mar 17, 2023

Coverage Status

Coverage: 96.427% (+0.5%) from 95.908% when pulling 2b34559 on unreachable-ctors-2 into 8225d4e on main.

@srawlins
Copy link
Member Author

This is ready for review.

static const LintCode code = LintCode('unreachable_from_main',
'Unreachable top-level member in an executable library.',
static const LintCode code = LintCode(
'unreachable_from_main', 'Unreachable member in an executable library.',
Copy link
Member

Choose a reason for hiding this comment

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

Consider adding the name of the member to the message for command-line users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, done!

@srawlins srawlins merged commit 6447552 into main Mar 29, 2023
@srawlins srawlins deleted the unreachable-ctors-2 branch March 29, 2023 21:16
pq added a commit that referenced this pull request Apr 3, 2023
pq added a commit that referenced this pull request Apr 3, 2023
srawlins added a commit that referenced this pull request May 11, 2023
#4162)" (#4253)"

This reverts commit b561905.

Also: Add support for test_reflective_loader
srawlins added a commit that referenced this pull request May 23, 2023
#4162)" (#4253)" (#4337)

This reverts commit b561905.

Also: Add support for test_reflective_loader
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 23, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 23, 2023
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.

3 participants