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.11k stars 1.57k forks source link

final decls not really final #3209

Closed stevemessick closed 9 years ago

stevemessick commented 12 years ago

This code should lead to three static type warnings but I get none. Assigning to x, y, or wob through a typed reference where the field is declared final should be flagged by the analyzer.


class Point {  final x, y;  Point(this.x, this.y); }

interface Wobulator default WobulatorImpl {  Wobulator();  final wob; }

class WobulatorImpl implements Wobulator {  var wob;  WobulatorImpl(); }

void main() {  Point p = new Point(2, 3);  p.x = 42;  p.y = 87;  Wobulator w = new Wobulator();  w.wob = 100; } //////////////////////////////////////////////////////////////////////////////////// Editor Version: 7937

scheglov commented 12 years ago

https://chromiumcodereview.appspot.com/10442018


Added Started label.

scheglov commented 12 years ago

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


Added Fixed label.