OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Test that setters cannot have defined, non-void return types. | 5 // Test that setters cannot have defined, non-void return types. |
6 // Note: The language specification specifies the absence of a type means | 6 // Note: The language specification specifies the absence of a type means |
7 // it is dynamic, however you cannot specify dynamic. | 7 // it is dynamic, however you cannot specify dynamic. |
8 | 8 |
9 class A { | 9 class A { |
10 set foo(x) {} | 10 set foo(x) {} |
11 void set bar(x) {} | 11 void set bar(x) {} |
12 dynamic set baz(x) {} /// 01: static type warning | 12 dynamic set baz(x) {} //# 01: static type warning |
13 bool set bob(x) {} /// 02: static type warning | 13 bool set bob(x) {} //# 02: static type warning |
14 } | 14 } |
15 | 15 |
16 main() { | 16 main() { |
17 new A(); | 17 new A(); |
18 } | 18 } |
OLD | NEW |