Files
sdk/tests
hausner@google.com 0ef3609ec0 Allow optional initializing formals again
After removing optional initializing formal parameters from the VM
yesterday, the language team decided that they should be allowed
and made usable.

- The name of an optional initializing formal is the name of
  the field it initializes.
- The parameter is only visible at the call site of the constructor,
  to name the parameter.
- The parameter is NOT visible in the constructor's initializer list
  and body.

class A {
  A([this.x = 10]);
  A.bad([this.x = 10]) : y = x;  // Error: parameter x not in scope
  A.ok([this.x = 10]) { print(x); } // Refers to field x, not parameter x.
  var x, y; 
}

o = new A(x: 50);  // o.x == 50.
o = new A();       // o.x == 10.
Review URL: http://codereview.chromium.org//8682025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1819 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:31:09 +00:00
..
2011-11-18 18:38:17 +00:00