- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.7k
 
Closed
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestdevexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.linter-lint-proposallinter-status-pending
Description
unreachable_from_main
Description
The description does not need to change.
Details
As implemented now (in dart-archive/linter#3513), unreachable_from_main only checks top-level members. It would be great to extend this to a few more things before removing the experimental bit.
- unreachable public static members on public classes, mixins, enums, and extensions
 - unreachable public instance members on public enums, including values, methods, getters, setters, operators
 
It would be great to report unreachable instance members of elements which participate in inheritance, but there is a lot more nuance involved, and risk for bugs. I don't feel strongly about it.
Kind
Unchanged
Good Examples
class C {
  static int i = 7;
}
void main() => print(C.i);Bad Examples
class C {
  static int i = 7;
}
enum E {
  one, two;
  int i = 7;
}Discussion
Discussion checklist
- List any existing rules this proposal modifies, complements, overlaps or conflicts with.
 - List any relevant issues (reported here, the SDK Tracker, or elsewhere).
 - If there's any prior art (e.g., in other linters), please add references here.
 - If this proposal corresponds to Effective Dart or Flutter Style Guide advice, please call it out. (If there isn’t any corresponding advice, should there be?)
 - If this proposal is motivated by real-world examples, please provide as many details as you can. Demonstrating potential impact is especially valuable.
 
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestdevexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.linter-lint-proposallinter-status-pending