Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Side by Side Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 1436433002: Issue 24751. Report a compile time error when @static_field is used with arguments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698