@@ -2859,6 +2859,16 @@ abstract class ErrorCode {
2859
2859
StrongModeCode .DOWN_CAST_IMPLICIT ,
2860
2860
StrongModeCode .DYNAMIC_CAST ,
2861
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
2872
StrongModeCode .INFERRED_TYPE ,
2863
2873
StrongModeCode .INFERRED_TYPE_ALLOCATION ,
2864
2874
StrongModeCode .INFERRED_TYPE_CLOSURE ,
@@ -5874,6 +5884,17 @@ class StrongModeCode extends ErrorCode {
5874
5884
'The type of {0}.{1} ({2}) is not a '
5875
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
5898
static const String _inferredTypeMessage = '{0} has inferred type {1}' ;
5878
5899
5879
5900
static const StrongModeCode DOWN_CAST_COMPOSITE = const StrongModeCode (
@@ -5947,6 +5968,63 @@ class StrongModeCode extends ErrorCode {
5947
5968
'Field declaration {3}.{1} cannot be '
5948
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
6028
@override
5951
6029
final ErrorType type;
5952
6030
0 commit comments