dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.3k stars 1.59k forks source link

Overriding an instance method with different default value for a formal parameter does not produce a static warning #3183

Closed DartBot closed 9 years ago

DartBot commented 12 years ago

This issue was originally filed by ms...@unipro.ru


What steps will reproduce the problem? Run the following test:

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

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

main() {   (new A()).foo(2);   (new C()).foo(1); }

What is the expected output? What do you see instead? Expected: static warning since default values are different. Actual: no static warnings.

What version of the product are you using? On what operating system? Dartc, r7892. OS: Ubuntu 10.04.

Please provide any additional information below. Tests in co19: Language/07_Classes/1_Instance_Methods_A04_t01.dart Language/07_Classes/1_Instance_Methods_A04_t02.dart Language/07_Classes/1_Instance_Methods_A04_t03.dart Language/07_Classes/1_Instance_Methods/1_Abstract_Methods_A07_t01.dart Language/07_Classes/1_Instance_Methods/1_Abstract_Methods_A07_t03.dartLanguage/07_Classes/1_Instance_Methods/1_Abstract_Methods_A07_t04.dartLanguage/07_Classes/1_Instance_Methods/1_Abstract_Methods_A07_t05.dartLanguage/07_Classes/1_Instance_Methods/1_Abstract_Methods_A07_t06.dart

kasperl commented 12 years ago

Added Area-Analyzer, Triaged labels.

danrubel commented 12 years ago

Added this to the M1 milestone.

scheglov commented 12 years ago

Set owner to @scheglov. Added Started label.

scheglov commented 12 years ago

https://chromiumcodereview.appspot.com/10543016

scheglov commented 12 years ago

https://code.google.com/p/dart/source/detail?r=8349


Added Fixed label.