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

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

Issue 2093523002: fix #25573, add option to disable implicit dynamic (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge remote-tracking branch 'origin/master' into no_implicit_dynamic Created 4 years, 5 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.error; 5 library analyzer.src.generated.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode;
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after
2852 StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER, 2852 StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER,
2853 StaticWarningCode.UNDEFINED_SUPER_GETTER, 2853 StaticWarningCode.UNDEFINED_SUPER_GETTER,
2854 StaticWarningCode.UNDEFINED_SUPER_SETTER, 2854 StaticWarningCode.UNDEFINED_SUPER_SETTER,
2855 StaticWarningCode.VOID_RETURN_FOR_GETTER, 2855 StaticWarningCode.VOID_RETURN_FOR_GETTER,
2856 StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 2856 StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
2857 StrongModeCode.ASSIGNMENT_CAST, 2857 StrongModeCode.ASSIGNMENT_CAST,
2858 StrongModeCode.DOWN_CAST_COMPOSITE, 2858 StrongModeCode.DOWN_CAST_COMPOSITE,
2859 StrongModeCode.DOWN_CAST_IMPLICIT, 2859 StrongModeCode.DOWN_CAST_IMPLICIT,
2860 StrongModeCode.DYNAMIC_CAST, 2860 StrongModeCode.DYNAMIC_CAST,
2861 StrongModeCode.DYNAMIC_INVOKE, 2861 StrongModeCode.DYNAMIC_INVOKE,
2862 StrongModeCode.IMPLICIT_DYNAMIC_FIELD,
2863 StrongModeCode.IMPLICIT_DYNAMIC_FUNCTION,
2864 StrongModeCode.IMPLICIT_DYNAMIC_INVOKE,
2865 StrongModeCode.IMPLICIT_DYNAMIC_LIST_LITERAL,
2866 StrongModeCode.IMPLICIT_DYNAMIC_MAP_LITERAL,
2867 StrongModeCode.IMPLICIT_DYNAMIC_METHOD,
2868 StrongModeCode.IMPLICIT_DYNAMIC_PARAMETER,
2869 StrongModeCode.IMPLICIT_DYNAMIC_RETURN,
2870 StrongModeCode.IMPLICIT_DYNAMIC_TYPE,
2871 StrongModeCode.IMPLICIT_DYNAMIC_VARIABLE,
2862 StrongModeCode.INFERRED_TYPE, 2872 StrongModeCode.INFERRED_TYPE,
2863 StrongModeCode.INFERRED_TYPE_ALLOCATION, 2873 StrongModeCode.INFERRED_TYPE_ALLOCATION,
2864 StrongModeCode.INFERRED_TYPE_CLOSURE, 2874 StrongModeCode.INFERRED_TYPE_CLOSURE,
2865 StrongModeCode.INFERRED_TYPE_LITERAL, 2875 StrongModeCode.INFERRED_TYPE_LITERAL,
2866 StrongModeCode.INVALID_FIELD_OVERRIDE, 2876 StrongModeCode.INVALID_FIELD_OVERRIDE,
2867 StrongModeCode.INVALID_METHOD_OVERRIDE, 2877 StrongModeCode.INVALID_METHOD_OVERRIDE,
2868 StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_BASE, 2878 StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_BASE,
2869 StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_MIXIN, 2879 StrongModeCode.INVALID_METHOD_OVERRIDE_FROM_MIXIN,
2870 StrongModeCode.INVALID_PARAMETER_DECLARATION, 2880 StrongModeCode.INVALID_PARAMETER_DECLARATION,
2871 StrongModeCode.INVALID_SUPER_INVOCATION, 2881 StrongModeCode.INVALID_SUPER_INVOCATION,
(...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after
5867 static const String _implicitCastMessage = 5877 static const String _implicitCastMessage =
5868 'Unsound implicit cast from {0} to {1}'; 5878 'Unsound implicit cast from {0} to {1}';
5869 5879
5870 static const String _typeCheckMessage = 5880 static const String _typeCheckMessage =
5871 'Type check failed: {0} is not of type {1}'; 5881 'Type check failed: {0} is not of type {1}';
5872 5882
5873 static const String _invalidOverrideMessage = 5883 static const String _invalidOverrideMessage =
5874 'The type of {0}.{1} ({2}) is not a ' 5884 'The type of {0}.{1} ({2}) is not a '
5875 'subtype of {3}.{1} ({4}).'; 5885 'subtype of {3}.{1} ({4}).';
5876 5886
5887 /**
5888 * This is appended to the end of an error message about implicit dynamic.
5889 *
5890 * The idea is to make sure the user is aware that this error message is the
5891 * result of turning on a particular option, and they are free to turn it
5892 * back off.
5893 */
5894 static const String _implicitDynamicTip =
5895 ". Either add an explicit type like 'dynamic'"
5896 ", or enable implicit-dynamic in your Analyzer options.";
5897
5877 static const String _inferredTypeMessage = '{0} has inferred type {1}'; 5898 static const String _inferredTypeMessage = '{0} has inferred type {1}';
5878 5899
5879 static const StrongModeCode DOWN_CAST_COMPOSITE = const StrongModeCode( 5900 static const StrongModeCode DOWN_CAST_COMPOSITE = const StrongModeCode(
5880 ErrorType.STATIC_WARNING, 'DOWN_CAST_COMPOSITE', _implicitCastMessage); 5901 ErrorType.STATIC_WARNING, 'DOWN_CAST_COMPOSITE', _implicitCastMessage);
5881 5902
5882 static const StrongModeCode DOWN_CAST_IMPLICIT = const StrongModeCode( 5903 static const StrongModeCode DOWN_CAST_IMPLICIT = const StrongModeCode(
5883 ErrorType.HINT, 'DOWN_CAST_IMPLICIT', _implicitCastMessage); 5904 ErrorType.HINT, 'DOWN_CAST_IMPLICIT', _implicitCastMessage);
5884 5905
5885 static const StrongModeCode DYNAMIC_CAST = const StrongModeCode( 5906 static const StrongModeCode DYNAMIC_CAST = const StrongModeCode(
5886 ErrorType.HINT, 'DYNAMIC_CAST', _implicitCastMessage); 5907 ErrorType.HINT, 'DYNAMIC_CAST', _implicitCastMessage);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
5940 ErrorType.COMPILE_TIME_ERROR, 5961 ErrorType.COMPILE_TIME_ERROR,
5941 'INVALID_METHOD_OVERRIDE_FROM_MIXIN', 5962 'INVALID_METHOD_OVERRIDE_FROM_MIXIN',
5942 'Mixin introduces an invalid override. $_invalidOverrideMessage'); 5963 'Mixin introduces an invalid override. $_invalidOverrideMessage');
5943 5964
5944 static const StrongModeCode INVALID_FIELD_OVERRIDE = const StrongModeCode( 5965 static const StrongModeCode INVALID_FIELD_OVERRIDE = const StrongModeCode(
5945 ErrorType.COMPILE_TIME_ERROR, 5966 ErrorType.COMPILE_TIME_ERROR,
5946 'INVALID_FIELD_OVERRIDE', 5967 'INVALID_FIELD_OVERRIDE',
5947 'Field declaration {3}.{1} cannot be ' 5968 'Field declaration {3}.{1} cannot be '
5948 'overridden in {0}.'); 5969 'overridden in {0}.');
5949 5970
5971 static const StrongModeCode IMPLICIT_DYNAMIC_PARAMETER = const StrongModeCode(
5972 ErrorType.COMPILE_TIME_ERROR,
5973 'IMPLICIT_DYNAMIC_PARAMETER',
5974 "Missing parameter type for '{0}'$_implicitDynamicTip");
5975
5976 static const StrongModeCode IMPLICIT_DYNAMIC_RETURN = const StrongModeCode(
5977 ErrorType.COMPILE_TIME_ERROR,
5978 'IMPLICIT_DYNAMIC_RETURN',
5979 "Missing return type for '{0}'$_implicitDynamicTip");
5980
5981 static const StrongModeCode IMPLICIT_DYNAMIC_VARIABLE = const StrongModeCode(
5982 ErrorType.COMPILE_TIME_ERROR,
5983 'IMPLICIT_DYNAMIC_VARIABLE',
5984 "Missing variable type for '{0}'$_implicitDynamicTip");
5985
5986 static const StrongModeCode IMPLICIT_DYNAMIC_FIELD = const StrongModeCode(
5987 ErrorType.COMPILE_TIME_ERROR,
5988 'IMPLICIT_DYNAMIC_FIELD',
5989 "Missing field type for '{0}'$_implicitDynamicTip");
5990
5991 static const StrongModeCode IMPLICIT_DYNAMIC_TYPE =
5992 const StrongModeCode(
5993 ErrorType.COMPILE_TIME_ERROR,
5994 'IMPLICIT_DYNAMIC_TYPE',
5995 "Missing type arguments for generic type '{0}'"
5996 "$_implicitDynamicTip");
5997
5998 static const StrongModeCode IMPLICIT_DYNAMIC_LIST_LITERAL =
5999 const StrongModeCode(
6000 ErrorType.COMPILE_TIME_ERROR,
6001 'IMPLICIT_DYNAMIC_LIST_LITERAL',
6002 "Missing type argument for list literal$_implicitDynamicTip");
6003
6004 static const StrongModeCode IMPLICIT_DYNAMIC_MAP_LITERAL =
6005 const StrongModeCode(
6006 ErrorType.COMPILE_TIME_ERROR,
6007 'IMPLICIT_DYNAMIC_MAP_LITERAL',
6008 'Missing type arguments for map literal$_implicitDynamicTip');
6009
6010 static const StrongModeCode IMPLICIT_DYNAMIC_FUNCTION = const StrongModeCode(
6011 ErrorType.COMPILE_TIME_ERROR,
6012 'IMPLICIT_DYNAMIC_FUNCTION',
6013 "Missing type arguments for generic function '{0}<{1}>'"
6014 "$_implicitDynamicTip");
6015
6016 static const StrongModeCode IMPLICIT_DYNAMIC_METHOD = const StrongModeCode(
6017 ErrorType.COMPILE_TIME_ERROR,
6018 'IMPLICIT_DYNAMIC_METHOD',
6019 "Missing type arguments for generic method '{0}<{1}>'"
6020 "$_implicitDynamicTip");
6021
6022 static const StrongModeCode IMPLICIT_DYNAMIC_INVOKE = const StrongModeCode(
6023 ErrorType.COMPILE_TIME_ERROR,
6024 'IMPLICIT_DYNAMIC_INVOKE',
6025 "Missing type arguments for calling generic function type '{0}'"
6026 "$_implicitDynamicTip");
6027
5950 @override 6028 @override
5951 final ErrorType type; 6029 final ErrorType type;
5952 6030
5953 /** 6031 /**
5954 * Initialize a newly created error code to have the given [type] and [name]. 6032 * Initialize a newly created error code to have the given [type] and [name].
5955 * 6033 *
5956 * The message associated with the error will be created from the given 6034 * The message associated with the error will be created from the given
5957 * [message] template. The correction associated with the error will be 6035 * [message] template. The correction associated with the error will be
5958 * created from the optional [correction] template. 6036 * created from the optional [correction] template.
5959 */ 6037 */
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
5996 * Initialize a newly created error code to have the given [name]. 6074 * Initialize a newly created error code to have the given [name].
5997 */ 6075 */
5998 const TodoCode(String name) : super(name, "{0}"); 6076 const TodoCode(String name) : super(name, "{0}");
5999 6077
6000 @override 6078 @override
6001 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 6079 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
6002 6080
6003 @override 6081 @override
6004 ErrorType get type => ErrorType.TODO; 6082 ErrorType get type => ErrorType.TODO;
6005 } 6083 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698