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

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

Issue 2640143007: Issue 28100. Implement new strong mode instantiate to bound rules in analyzer. (Closed)
Patch Set: Created 3 years, 11 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.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 4886 matching lines...) Expand 10 before | Expand all | Expand 10 after
4897 'IMPLICIT_DYNAMIC_INVOKE', 4897 'IMPLICIT_DYNAMIC_INVOKE',
4898 "Missing type arguments for calling generic function type '{0}'.", 4898 "Missing type arguments for calling generic function type '{0}'.",
4899 _implicitDynamicCorrection); 4899 _implicitDynamicCorrection);
4900 4900
4901 static const StrongModeCode NOT_INSTANTIATED_BOUND = const StrongModeCode( 4901 static const StrongModeCode NOT_INSTANTIATED_BOUND = const StrongModeCode(
4902 ErrorType.COMPILE_TIME_ERROR, 4902 ErrorType.COMPILE_TIME_ERROR,
4903 'NOT_INSTANTIATED_BOUND', 4903 'NOT_INSTANTIATED_BOUND',
4904 "Type parameter bound types must be instantiated.", 4904 "Type parameter bound types must be instantiated.",
4905 "Try adding type arguments."); 4905 "Try adding type arguments.");
4906 4906
4907 static const StrongModeCode UNABLE_INSTANTIATE_TO_BOUNDS =
4908 const StrongModeCode(
4909 ErrorType.COMPILE_TIME_ERROR,
4910 'UNABLE_INSTANTIATE_TO_BOUNDS',
4911 "Unable to instantiate to bounds.",
Leaf 2017/01/20 20:31:52 Maybe "Type has no default bounds", "Try adding ex
scheglov 2017/01/21 02:11:23 Done.
4912 "Try adding type arguments.");
4913
4907 static const StrongModeCode UNSAFE_BLOCK_CLOSURE_INFERENCE = const StrongModeC ode( 4914 static const StrongModeCode UNSAFE_BLOCK_CLOSURE_INFERENCE = const StrongModeC ode(
4908 ErrorType.STATIC_WARNING, 4915 ErrorType.STATIC_WARNING,
4909 'UNSAFE_BLOCK_CLOSURE_INFERENCE', 4916 'UNSAFE_BLOCK_CLOSURE_INFERENCE',
4910 "Unsafe use of a block closure in a type-inferred variable outside a funct ion body.", 4917 "Unsafe use of a block closure in a type-inferred variable outside a funct ion body.",
4911 "Try adding a type annotation for '{0}'. See dartbug.com/26947."); 4918 "Try adding a type annotation for '{0}'. See dartbug.com/26947.");
4912 4919
4913 @override 4920 @override
4914 final ErrorType type; 4921 final ErrorType type;
4915 4922
4916 /** 4923 /**
4917 * Initialize a newly created error code to have the given [type] and [name]. 4924 * Initialize a newly created error code to have the given [type] and [name].
4918 * 4925 *
4919 * The message associated with the error will be created from the given 4926 * The message associated with the error will be created from the given
4920 * [message] template. The correction associated with the error will be 4927 * [message] template. The correction associated with the error will be
4921 * created from the optional [correction] template. 4928 * created from the optional [correction] template.
4922 */ 4929 */
4923 const StrongModeCode(ErrorType type, String name, String message, 4930 const StrongModeCode(ErrorType type, String name, String message,
4924 [String correction]) 4931 [String correction])
4925 : type = type, 4932 : type = type,
4926 super('STRONG_MODE_$name', message, correction); 4933 super('STRONG_MODE_$name', message, correction);
4927 4934
4928 @override 4935 @override
4929 ErrorSeverity get errorSeverity => type.severity; 4936 ErrorSeverity get errorSeverity => type.severity;
4930 } 4937 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698