| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 Element get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 3977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3988 return null; | 3988 return null; |
| 3989 } | 3989 } |
| 3990 if (!definitions.tail.isEmpty) { | 3990 if (!definitions.tail.isEmpty) { |
| 3991 cancel(definitions.tail.head, 'internal error: extra definition'); | 3991 cancel(definitions.tail.head, 'internal error: extra definition'); |
| 3992 return null; | 3992 return null; |
| 3993 } | 3993 } |
| 3994 Node definition = definitions.head; | 3994 Node definition = definitions.head; |
| 3995 if (definition is NodeList) { | 3995 if (definition is NodeList) { |
| 3996 cancel(node, 'optional parameters are not implemented'); | 3996 cancel(node, 'optional parameters are not implemented'); |
| 3997 } | 3997 } |
| 3998 if (node.modifiers.isConst()) { |
| 3999 error(node, MessageKind.FORMAL_DECLARED_CONST); |
| 4000 } |
| 3998 | 4001 |
| 3999 if (currentDefinitions != null) { | 4002 if (currentDefinitions != null) { |
| 4000 cancel(node, 'function type parameters not supported'); | 4003 cancel(node, 'function type parameters not supported'); |
| 4001 } | 4004 } |
| 4002 currentDefinitions = node; | 4005 currentDefinitions = node; |
| 4003 Element element = definition.accept(this); | 4006 Element element = definition.accept(this); |
| 4004 currentDefinitions = null; | 4007 currentDefinitions = null; |
| 4005 return element; | 4008 return element; |
| 4006 } | 4009 } |
| 4007 | 4010 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4339 return e; | 4342 return e; |
| 4340 } | 4343 } |
| 4341 | 4344 |
| 4342 /// Assumed to be called by [resolveRedirectingFactory]. | 4345 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4343 Element visitReturn(Return node) { | 4346 Element visitReturn(Return node) { |
| 4344 Node expression = node.expression; | 4347 Node expression = node.expression; |
| 4345 return finishConstructorReference(visit(expression), | 4348 return finishConstructorReference(visit(expression), |
| 4346 expression, expression); | 4349 expression, expression); |
| 4347 } | 4350 } |
| 4348 } | 4351 } |
| OLD | NEW |