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 not warning when overriding method does not include the same default values #18914

Closed
bwilkerson opened this issue May 20, 2014 · 9 comments
Assignees
Labels
analyzer-test area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Milestone

Comments

@bwilkerson
Copy link
Member

Section of the specification states:

It is a static warning if an instance method m1 overrides an instance member m2, the signature of m2 explicitly specifies a default value for a formal parameter p and the signature of m1 specifies a different default value for p.

But the following code produces no warning:

class A {
  foo([x = 1]) {}
}

class B extends A {
  foo([x]) {}
}

This is causing the co19 test Language/07_Classes/4_Abstract_Instance_Members_A07_t02 to fail.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the 1.5 milestone.
Added this to the 1.6 milestone.

@whesse
Copy link
Member

whesse commented Jun 11, 2014

The test now passes on dartanalyzer, but still fails on dart2analyzer. What is the status of this bug?

@bwilkerson
Copy link
Member Author

I don't know why the test is passing, but analyzer still does not produce a warning for the code sample above, so the issue is not fixed.

@kasperl
Copy link

kasperl commented Jul 10, 2014

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

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@stereotype441
Copy link
Member

Set owner to @stereotype441.
Added Started label.

@stereotype441
Copy link
Member

Fix sent out for review: https://codereview.chromium.org/700923002/

@stereotype441
Copy link
Member

Fixed in revision 41503.


Added Fixed label.

@clayberg
Copy link

Added this to the 1.8 milestone.

@bwilkerson bwilkerson added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-test labels Nov 28, 2014
@bwilkerson bwilkerson added this to the 1.8 milestone Nov 28, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-test area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

5 participants