OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 class FormalCollision { | 5 class FormalCollision { |
6 // These shouldn't collide (see issue #136) | 6 // These shouldn't collide (see issue #136) |
7 int _x, __x; | 7 int _x, __x; |
8 // This shouldn't generate a keyword as an identifier. | 8 // This shouldn't generate a keyword as an identifier. |
9 Function _function; | 9 Function _function; |
10 FormalCollision(this._x, this.__x, this._function); | 10 FormalCollision(this._x, this.__x, this._function); |
11 } | 11 } |
12 | 12 |
13 class OptionalArg { | 13 class OptionalArg { |
14 int _opt; | 14 int opt, _opt; |
15 OptionalArg([this._opt = 123]); | 15 OptionalArg([this._opt = 123]); |
16 OptionalArg.named({this._opt: 456}); | 16 OptionalArg.named({this.opt: 456}); |
17 } | 17 } |
18 | 18 |
19 main() { | 19 main() { |
20 print(new FormalCollision(1, 2, (x) => x)); | 20 print(new FormalCollision(1, 2, (x) => x)); |
21 print(new OptionalArg()._opt); | 21 print(new OptionalArg()._opt); |
22 print(new OptionalArg.named()._opt); | 22 print(new OptionalArg.named()._opt); |
23 } | 23 } |
OLD | NEW |