| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 for static warnings for member access on classes with @proxy annotation. | 5 // Test for static warnings for member access on classes with @proxy annotation. |
| 6 | 6 |
| 7 class NonProxy {} | 7 class NonProxy {} |
| 8 | 8 |
| 9 @proxy | 9 @proxy |
| 10 class Proxy {} | 10 class Proxy {} |
| 11 | 11 |
| 12 const alias = proxy; | 12 const alias = proxy; |
| 13 | 13 |
| 14 @alias | 14 @alias |
| 15 class AliasProxy {} | 15 class AliasProxy {} |
| 16 | 16 |
| 17 main() { | 17 main() { |
| 18 try { new NonProxy().foo; } catch (e) {} //# 01: static type warning | 18 try { new NonProxy().foo; } catch (e) {} //# 01: static type warning |
| 19 try { new NonProxy().foo(); } catch (e) {} //# 02: static type warning | 19 try { new NonProxy().foo(); } catch (e) {} //# 02: static type warning |
| 20 | 20 |
| 21 try { new Proxy().foo; } catch (e) {} //# 03: ok | 21 try { new Proxy().foo; } catch (e) {} //# 03: ok |
| 22 try { new Proxy().foo(); } catch (e) {} //# 04: ok | 22 try { new Proxy().foo(); } catch (e) {} //# 04: ok |
| 23 | 23 |
| 24 try { new AliasProxy().foo; } catch (e) {} //# 05: ok | 24 try { new AliasProxy().foo; } catch (e) {} //# 05: ok |
| 25 try { new AliasProxy().foo(); } catch (e) {} //# 06: ok | 25 try { new AliasProxy().foo(); } catch (e) {} //# 06: ok |
| 26 } | 26 } |
| OLD | NEW |