OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 /// Contains all warning messages produced by the observe transformer. | |
6 library observe.src.messages; | |
7 | |
8 import 'package:code_transformers/messages/messages.dart'; | |
9 | |
10 const NO_OBSERVABLE_ON_LIBRARY = const MessageTemplate( | |
11 const MessageId('observe', 1), | |
12 '@observable on a library no longer has any effect. ' | |
13 'Instead, annotate individual fields as @observable.', | |
14 '`@observable` not supported on libraries', | |
15 _COMMON_MESSAGE_WHERE_TO_USE_OBSERVABLE); | |
16 | |
17 const NO_OBSERVABLE_ON_TOP_LEVEL = const MessageTemplate( | |
18 const MessageId('observe', 2), | |
19 'Top-level fields can no longer be observable. ' | |
20 'Observable fields must be in observable objects.', | |
21 '`@observable` not supported on top-level fields', | |
22 _COMMON_MESSAGE_WHERE_TO_USE_OBSERVABLE); | |
23 | |
24 const NO_OBSERVABLE_ON_CLASS = const MessageTemplate( | |
25 const MessageId('observe', 3), | |
26 '@observable on a class no longer has any effect. ' | |
27 'Instead, annotate individual fields as @observable.', | |
28 '`@observable` not supported on classes', | |
29 _COMMON_MESSAGE_WHERE_TO_USE_OBSERVABLE); | |
30 | |
31 const NO_OBSERVABLE_ON_STATIC_FIELD = const MessageTemplate( | |
32 const MessageId('observe', 4), | |
33 'Static fields can no longer be observable. ' | |
34 'Observable fields must be in observable objects.', | |
35 '`@observable` not supported on static fields', | |
36 _COMMON_MESSAGE_WHERE_TO_USE_OBSERVABLE); | |
37 | |
38 const REQUIRE_OBSERVABLE_INTERFACE = const MessageTemplate( | |
39 const MessageId('observe', 5), | |
40 'Observable fields must be in observable objects. ' | |
41 'Change this class to extend, mix in, or implement Observable.', | |
42 '`@observable` field not in an `Observable` class', | |
43 _COMMON_MESSAGE_WHERE_TO_USE_OBSERVABLE); | |
44 | |
45 const String _COMMON_MESSAGE_WHERE_TO_USE_OBSERVABLE = ''' | |
46 Only instance fields on `Observable` classes can be observable, | |
47 and you must explicitly annotate each observable field as `@observable`. | |
48 | |
49 Support for using the `@observable` annotation in libraries, classes, and | |
50 elsewhere is deprecated. | |
51 '''; | |
OLD | NEW |