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

analyzer: warn if public member returns private type #6865

Closed
kevmoo opened this issue Nov 21, 2012 · 14 comments
Closed

analyzer: warn if public member returns private type #6865

kevmoo opened this issue Nov 21, 2012 · 14 comments
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@kevmoo
Copy link
Member

kevmoo commented Nov 21, 2012

Scenario:

class _PrivateType {
}

_PrivateType getInfo() {
  // do something
}

getInfo is public, but the return type is private to the library. Would be great to get a warning in this case.

@dgrove
Copy link
Contributor

dgrove commented Nov 21, 2012

Added Area-Analyzer, Triaged labels.

@bwilkerson
Copy link
Member

Added this to the M3 milestone.

@bwilkerson
Copy link
Member

Removed Type-Defect label.
Added Type-Enhancement label.

@scheglov
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the Later milestone.
Added AnalysisEngine label.

@DartBot
Copy link

DartBot commented Apr 7, 2013

This comment was originally written by amouravski@google.com


Added Editor-AnalysisEngine label.

@bwilkerson
Copy link
Member

Removed AnalysisEngine, Editor-AnalysisEngine labels.

@kevmoo
Copy link
Member Author

kevmoo commented Nov 30, 2013

Also: void doWork(_PrivateType value) {}

@bwilkerson
Copy link
Member

We need to think about whether there's any way to produce valid information without false positives. Consider, for example, private classes with public subclasses (for the parameter case) or private classes that implement public interfaces (for the return type case).


Removed Priority-Medium label.
Added Priority-Low, Analyzer-Hint labels.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added Type-Enhancement P3 A lower priority bug or feature request area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-warning Issues with the analyzer's Warning codes labels Aug 4, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@pq
Copy link
Member

pq commented Jun 29, 2018

@bwilkerson I could have sworn there was an issue tracking a similar idea in the linter package; I know we've discussed it. (Didn't you prototype something?) . In any event, it seems like this could be moved or merged there?

@bwilkerson
Copy link
Member

I have a tool that does that and more. I don't have it in the form of a lint rule, but it could be converted easily enough if someone had the time.

@bwilkerson
Copy link
Member

Personally, I don't care which issue tracker lint-related issues are in.

@pq
Copy link
Member

pq commented Jun 29, 2018

This issue was moved to dart-lang/linter#1054

@pq pq closed this as completed Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants