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

Side by Side Diff: pkg/analyzer/lib/src/error/codes.dart

Issue 2487583002: Convert generic method errors to hints (Closed)
Patch Set: address comments Created 4 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
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.error.codes; 5 library analyzer.src.error.codes;
6 6
7 import 'package:analyzer/error/error.dart'; 7 import 'package:analyzer/error/error.dart';
8 8
9 export 'package:analyzer/src/analysis_options/error/option_codes.dart'; 9 export 'package:analyzer/src/analysis_options/error/option_codes.dart';
10 export 'package:analyzer/src/dart/error/hint_codes.dart'; 10 export 'package:analyzer/src/dart/error/hint_codes.dart';
(...skipping 3068 matching lines...) Expand 10 before | Expand all | Expand 10 after
3079 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]. 3079 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS].
3080 */ 3080 */
3081 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = 3081 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS =
3082 const StaticTypeWarningCode( 3082 const StaticTypeWarningCode(
3083 'WRONG_NUMBER_OF_TYPE_ARGUMENTS', 3083 'WRONG_NUMBER_OF_TYPE_ARGUMENTS',
3084 "The type '{0}' is declared with {1} type parameters, " 3084 "The type '{0}' is declared with {1} type parameters, "
3085 "but {2} type arguments were given.", 3085 "but {2} type arguments were given.",
3086 "Try adjusting the number of type arguments."); 3086 "Try adjusting the number of type arguments.");
3087 3087
3088 /** 3088 /**
3089 * It will be a static type warning if <i>m</i> is not a generic method with
3090 * exactly <i>n</i> type parameters.
3091 *
3092 * Parameters:
3093 * 0: the name of the method being referenced (<i>G</i>)
3094 * 1: the number of type parameters that were declared
3095 * 2: the number of type arguments provided
3096 */
3097 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD =
3098 const StaticTypeWarningCode(
3099 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD',
3100 "The method '{0}' is declared with {1} type parameters, "
3101 "but {2} type arguments were given.",
3102 "Try adjusting the number of type arguments.");
3103
3104 /**
3089 * 17.16.1 Yield: Let T be the static type of e [the expression to the right 3105 * 17.16.1 Yield: Let T be the static type of e [the expression to the right
3090 * of "yield"] and let f be the immediately enclosing function. It is a 3106 * of "yield"] and let f be the immediately enclosing function. It is a
3091 * static type warning if either: 3107 * static type warning if either:
3092 * 3108 *
3093 * - the body of f is marked async* and the type Stream<T> may not be 3109 * - the body of f is marked async* and the type Stream<T> may not be
3094 * assigned to the declared return type of f. 3110 * assigned to the declared return type of f.
3095 * 3111 *
3096 * - the body of f is marked sync* and the type Iterable<T> may not be 3112 * - the body of f is marked sync* and the type Iterable<T> may not be
3097 * assigned to the declared return type of f. 3113 * assigned to the declared return type of f.
3098 * 3114 *
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
4887 * created from the optional [correction] template. 4903 * created from the optional [correction] template.
4888 */ 4904 */
4889 const StrongModeCode(ErrorType type, String name, String message, 4905 const StrongModeCode(ErrorType type, String name, String message,
4890 [String correction]) 4906 [String correction])
4891 : type = type, 4907 : type = type,
4892 super('STRONG_MODE_$name', message, correction); 4908 super('STRONG_MODE_$name', message, correction);
4893 4909
4894 @override 4910 @override
4895 ErrorSeverity get errorSeverity => type.severity; 4911 ErrorSeverity get errorSeverity => type.severity;
4896 } 4912 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/error/hint_codes.dart ('k') | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698