OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
8 /// | 8 /// |
9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 Operator, | 1247 Operator, |
1248 Factory, | 1248 Factory, |
1249 } | 1249 } |
1250 | 1250 |
1251 // ------------------------------------------------------------------------ | 1251 // ------------------------------------------------------------------------ |
1252 // CONSTRUCTOR INITIALIZERS | 1252 // CONSTRUCTOR INITIALIZERS |
1253 // ------------------------------------------------------------------------ | 1253 // ------------------------------------------------------------------------ |
1254 | 1254 |
1255 /// Part of an initializer list in a constructor. | 1255 /// Part of an initializer list in a constructor. |
1256 abstract class Initializer extends TreeNode { | 1256 abstract class Initializer extends TreeNode { |
| 1257 /// True if this is a synthetic constructor initializer. |
| 1258 @informative |
| 1259 bool isSynthetic = false; |
| 1260 |
1257 accept(InitializerVisitor v); | 1261 accept(InitializerVisitor v); |
1258 } | 1262 } |
1259 | 1263 |
1260 /// An initializer with a compile-time error. | 1264 /// An initializer with a compile-time error. |
1261 /// | 1265 /// |
1262 /// Should throw an exception at runtime. | 1266 /// Should throw an exception at runtime. |
1263 // | 1267 // |
1264 // DESIGN TODO: The frontend should use this in a lot more cases to catch | 1268 // DESIGN TODO: The frontend should use this in a lot more cases to catch |
1265 // invalid cases. | 1269 // invalid cases. |
1266 class InvalidInitializer extends Initializer { | 1270 class InvalidInitializer extends Initializer { |
(...skipping 3400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4667 if (typedef_.canonicalName == null) { | 4671 if (typedef_.canonicalName == null) { |
4668 throw '$typedef_ has no canonical name'; | 4672 throw '$typedef_ has no canonical name'; |
4669 } | 4673 } |
4670 return typedef_.canonicalName; | 4674 return typedef_.canonicalName; |
4671 } | 4675 } |
4672 | 4676 |
4673 /// Annotation describing information which is not part of Dart semantics; in | 4677 /// Annotation describing information which is not part of Dart semantics; in |
4674 /// other words, if this information (or any information it refers to) changes, | 4678 /// other words, if this information (or any information it refers to) changes, |
4675 /// static analysis and runtime behavior of the library are unaffected. | 4679 /// static analysis and runtime behavior of the library are unaffected. |
4676 const informative = null; | 4680 const informative = null; |
OLD | NEW |