| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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 library engine.resolver.element_resolver; | 5 library engine.resolver.element_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'ast.dart'; | 9 import 'ast.dart'; |
| 10 import 'element.dart'; | 10 import 'element.dart'; |
| (...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 _resolver.reportErrorForNode( | 1872 _resolver.reportErrorForNode( |
| 1873 CompileTimeErrorCode.INVALID_ANNOTATION, annotation); | 1873 CompileTimeErrorCode.INVALID_ANNOTATION, annotation); |
| 1874 return; | 1874 return; |
| 1875 } | 1875 } |
| 1876 // variable should be constant | 1876 // variable should be constant |
| 1877 VariableElement variableElement = accessorElement.variable; | 1877 VariableElement variableElement = accessorElement.variable; |
| 1878 if (!variableElement.isConst) { | 1878 if (!variableElement.isConst) { |
| 1879 _resolver.reportErrorForNode( | 1879 _resolver.reportErrorForNode( |
| 1880 CompileTimeErrorCode.INVALID_ANNOTATION, annotation); | 1880 CompileTimeErrorCode.INVALID_ANNOTATION, annotation); |
| 1881 } | 1881 } |
| 1882 // no arguments |
| 1883 if (annotation.arguments != null) { |
| 1884 _resolver.reportErrorForNode( |
| 1885 CompileTimeErrorCode.ANNOTATION_WITH_NON_CLASS, |
| 1886 annotation.name, |
| 1887 [annotation.name]); |
| 1888 } |
| 1882 // OK | 1889 // OK |
| 1883 return; | 1890 return; |
| 1884 } | 1891 } |
| 1885 | 1892 |
| 1886 /** | 1893 /** |
| 1887 * Given an [argumentList] and the [executableElement] that will be invoked | 1894 * Given an [argumentList] and the [executableElement] that will be invoked |
| 1888 * using those argument, compute the list of parameters that correspond to the | 1895 * using those argument, compute the list of parameters that correspond to the |
| 1889 * list of arguments. An error will be reported if any of the arguments cannot | 1896 * list of arguments. An error will be reported if any of the arguments cannot |
| 1890 * be matched to a parameter. The flag [reportError] should be `true` if a | 1897 * be matched to a parameter. The flag [reportError] should be `true` if a |
| 1891 * compile-time error should be reported; or `false` if a compile-time warning | 1898 * compile-time error should be reported; or `false` if a compile-time warning |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2580 | 2587 |
| 2581 @override | 2588 @override |
| 2582 Element get staticElement => null; | 2589 Element get staticElement => null; |
| 2583 | 2590 |
| 2584 @override | 2591 @override |
| 2585 accept(AstVisitor visitor) => null; | 2592 accept(AstVisitor visitor) => null; |
| 2586 | 2593 |
| 2587 @override | 2594 @override |
| 2588 void visitChildren(AstVisitor visitor) {} | 2595 void visitChildren(AstVisitor visitor) {} |
| 2589 } | 2596 } |
| OLD | NEW |