Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // When attempting to call a nonexistent static method, getter or setter, check | 5 // When attempting to call a nonexistent static method, getter or setter, check |
| 6 // that a NoSuchMethodError is thrown. | 6 // that a NoSuchMethodError is thrown. |
| 7 | 7 |
| 8 class C {} | 8 class C {} |
| 9 | 9 |
| 10 class D { | |
| 11 get hest => 1; /// 04: continued | |
| 12 set hest(val) {} /// 05: continued | |
| 13 } | |
| 14 | |
| 15 get fisk => 2; /// 09: continued | |
| 16 set fisk(val) {} /// 10: continued | |
| 17 | |
| 10 main() { | 18 main() { |
| 11 Expect.throws(() => C.hest = 1, (e) => e is NoSuchMethodError); /// 01: static type warning | 19 Expect.throws(() => C.hest = 1, (e) => e is NoSuchMethodError); /// 01: static type warning |
| 12 Expect.throws(() => C.hest, (e) => e is NoSuchMethodError); /// 02: static type warning | 20 Expect.throws(() => C.hest, (e) => e is NoSuchMethodError); /// 02: static type warning |
| 13 Expect.throws(() => C.hest(), (e) => e is NoSuchMethodError); /// 03: static type warning | 21 Expect.throws(() => C.hest(), (e) => e is NoSuchMethodError); /// 03: static type warning |
| 22 Expect.throws(() => D.hest = 1, (e) => e is NoSuchMethodError); /// 04: static type warning | |
|
ahe
2012/09/13 12:31:14
Line is longer than 80 columns.
Which reveals an
karlklose
2012/09/13 13:47:26
I changed the test.
| |
| 23 Expect.throws(() => D.hest, (e) => e is NoSuchMethodError); /// 05: static type warning | |
| 24 Expect.throws(() => fisk = 1, (e) => e is NoSuchMethodError); /// 06: static type warning | |
| 25 Expect.throws(() => fisk, (e) => e is NoSuchMethodError); /// 07: static type warning | |
| 26 Expect.throws(() => fisk(), (e) => e is NoSuchMethodError); /// 08: static type warning | |
| 27 Expect.throws(() => fisk = 1, (e) => e is NoSuchMethodError); /// 09: static type warning | |
| 28 Expect.throws(() => fisk, (e) => e is NoSuchMethodError); /// 10: static type warning | |
| 14 } | 29 } |
| OLD | NEW |