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

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

Issue 2931893004: Report an error when a part-of refers to an unnamed library. (Closed)
Patch Set: Address comments. Created 3 years, 6 months 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
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 analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 4938 matching lines...) Expand 10 before | Expand all | Expand 10 after
4949 4949
4950 static const ResolverErrorCode CONTINUE_LABEL_ON_SWITCH = 4950 static const ResolverErrorCode CONTINUE_LABEL_ON_SWITCH =
4951 const ResolverErrorCode('CONTINUE_LABEL_ON_SWITCH', 4951 const ResolverErrorCode('CONTINUE_LABEL_ON_SWITCH',
4952 "A continue label resolves to switch, must be loop or switch member"); 4952 "A continue label resolves to switch, must be loop or switch member");
4953 4953
4954 static const ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART = 4954 static const ResolverErrorCode MISSING_LIBRARY_DIRECTIVE_WITH_PART =
4955 const ResolverErrorCode('MISSING_LIBRARY_DIRECTIVE_WITH_PART', 4955 const ResolverErrorCode('MISSING_LIBRARY_DIRECTIVE_WITH_PART',
4956 "Libraries that have parts must have a library directive"); 4956 "Libraries that have parts must have a library directive");
4957 4957
4958 /** 4958 /**
4959 * Parts: It is a static warning if the referenced part declaration
4960 * <i>p</i> names a library that does not have a library tag.
4961 *
4962 * Parameters:
4963 * 0: the URI of the expected library
4964 * 1: the non-matching actual library name from the "part of" declaration
4965 */
4966 static const ResolverErrorCode PART_OF_UNNAMED_LIBRARY =
4967 const ResolverErrorCode(
4968 'PART_OF_UNNAMED_LIBRARY',
4969 "Library is unnamed. Expected a URI not a library name '{0}' in the "
4970 "part-of directive.",
4971 "Try changing the part-of directive to a URI, or try including a"
4972 " different part.");
4973
4974 /**
4959 * Initialize a newly created error code to have the given [name]. The message 4975 * Initialize a newly created error code to have the given [name]. The message
4960 * associated with the error will be created from the given [message] 4976 * associated with the error will be created from the given [message]
4961 * template. The correction associated with the error will be created from the 4977 * template. The correction associated with the error will be created from the
4962 * given [correction] template. 4978 * given [correction] template.
4963 */ 4979 */
4964 const ResolverErrorCode(String name, String message, [String correction]) 4980 const ResolverErrorCode(String name, String message, [String correction])
4965 : super(name, message, correction); 4981 : super(name, message, correction);
4966 4982
4967 @override 4983 @override
4968 ErrorSeverity get errorSeverity => type.severity; 4984 ErrorSeverity get errorSeverity => type.severity;
(...skipping 5927 matching lines...) Expand 10 before | Expand all | Expand 10 after
10896 return null; 10912 return null;
10897 } 10913 }
10898 if (identical(node.staticElement, variable)) { 10914 if (identical(node.staticElement, variable)) {
10899 if (node.inSetterContext()) { 10915 if (node.inSetterContext()) {
10900 result = true; 10916 result = true;
10901 } 10917 }
10902 } 10918 }
10903 return null; 10919 return null;
10904 } 10920 }
10905 } 10921 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698