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.26k stars 1.58k forks source link

Duplicate final initializes do not cause a compile error #1035

Closed jtmcdole closed 9 years ago

jtmcdole commented 12 years ago

New test, language/ConstructorDuplicateInitializersTest.dart:

class Class {   Class(var v)     : field = v     , field = 2 /// 01: compile-time error   ;   Class.field(this.field)     : field = 2 /// 02: compile-time error   ;   final field_; }

main() {   new Class(42);   new Class.field(42); }

Similar to http://code.google.com/p/dart/issues/detail?id=1034

anders-sandholm commented 12 years ago

Removed Area-Frog label. Added Area-Dart2JS, FromAreaFrog labels.

kasperl commented 12 years ago

Another negative language test issue.


Set owner to @peter-ahe-google. Removed FromAreaFrog label. Added Accepted label. Changed the title to: "Duplicate final initializes do not cause a compile error".

peter-ahe-google commented 12 years ago

Added this to the M1 milestone. Removed Priority-Medium label. Added Priority-High label.

peter-ahe-google commented 12 years ago

dart2js fails to reject subtest 02:

  Class.field(this.field)     : field = 2 /// 02: compile-time error   ;

johnniwinther commented 12 years ago

cc @peter-ahe-google. Set owner to @johnniwinther. Added Started label.

johnniwinther commented 12 years ago

Has been fixed for a long time.


Added Fixed label.

peter-ahe-google commented 12 years ago

This bug is not fixed, this is from dart/tests/language/language_dart2js.status:

constructor_duplicate_initializers_test/02: Fail, OK # Negative language test.


cc @johnniwinther. Set owner to @peter-ahe-google. Added Accepted label.

DartBot commented 12 years ago

This comment was originally written by @aam


Please, take a look at the following fix https://chromiumcodereview.appspot.com/10834327/

peter-ahe-google commented 12 years ago

I'll commit the change on behalf of Alexander.


Added Started label.

peter-ahe-google commented 12 years ago

Fixed in r10947.


Added Fixed label.