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

Request for exit analysis #11485

Closed
stevemessick opened this issue Jun 24, 2013 · 5 comments
Closed

Request for exit analysis #11485

stevemessick opened this issue Jun 24, 2013 · 5 comments
Assignees
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@stevemessick
Copy link
Contributor

Can we have the following method be flagged. It's signature says to return a string but it is not returning anything.

  String format(value, [String parameters = null]) {
    // Handle null case.
    if (value == null) {
      return '';
    }
    // Handle case where an object other than an array is passed.
    if (!(value is Iterable)) {
      return value.toString();
    }
    // Handle empty list.
    if (value.isEmpty) {
      return '';
    }
    _formatValue(value, parameters);
  }
////////////////////////////////////////////////////////////////////////////////////
Editor: 0.5.20_r24160 (2013-06-18)
OS: Linux - amd64 (3.2.5-gg1236)
JVM: 1.7.0-google-v5

projects: 2

open dart files: 19

auto-run pub: false
localhost resolves to: 127.0.0.1
mem max/total/free: 1778 / 786 / 505 MB
thread count: 33
index: 483112 relationships in 114610 keys in 831 sources

SDK installed: true
Dartium installed: true
analysis engine: new

@bwilkerson
Copy link
Member

Can we have the following method be flagged.

Yes. I expect this to be one of the things the linter looks for.

It's signature says to return a string but it is not returning anything.

Actually, it's returning null. According to the specification:

If the last statement of a function is not a return statement, the statement "return null;" is implicitly appended to the function body.


Removed Area-Editor label.
Added Area-Analyzer label.

@bwilkerson
Copy link
Member

Added Analyzer-Hint label.

@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.

@stevemessick stevemessick added Type-Enhancement area-analyzer analyzer-warning Issues with the analyzer's Warning codes labels Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@srawlins
Copy link
Member

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 P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants