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

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

Issue 1422813003: Add hint for use of ?. in conditions (issue 24649) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add checks for asserts, and conditional expressions Created 5 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 engine.error; 5 library engine.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:source_span/source_span.dart'; 9 import 'package:source_span/source_span.dart';
10 10
(...skipping 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after
3016 * 3016 *
3017 * Parameters: 3017 * Parameters:
3018 * 0: the name of the declared return type 3018 * 0: the name of the declared return type
3019 */ 3019 */
3020 static const HintCode MISSING_RETURN = const HintCode( 3020 static const HintCode MISSING_RETURN = const HintCode(
3021 'MISSING_RETURN', 3021 'MISSING_RETURN',
3022 "This function declares a return type of '{0}', but does not end with a re turn statement", 3022 "This function declares a return type of '{0}', but does not end with a re turn statement",
3023 "Either add a return statement or change the return type to 'void'"); 3023 "Either add a return statement or change the return type to 'void'");
3024 3024
3025 /** 3025 /**
3026 * Generate a hint for conditions in control flow statements that uses the
pquitslund 2015/10/28 04:40:35 uses => use?
Brian Wilkerson 2015/10/28 15:27:38 Actually, it needed a bigger re-write than that. B
3027 * null-aware '?.' operator.
3028 */
3029 static const HintCode NULL_AWARE_IN_CONDITION = const HintCode(
3030 'NULL_AWARE_IN_CONDITION',
3031 "The value of the '?.' operator can be 'null', which is not appropriate in a condition",
3032 "Replace the '?.' with a '.', testing the left-hand side for null if neces sary");
3033
3034 /**
3026 * A getter with the override annotation does not override an existing getter. 3035 * A getter with the override annotation does not override an existing getter.
3027 */ 3036 */
3028 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode( 3037 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode(
3029 'OVERRIDE_ON_NON_OVERRIDING_GETTER', 3038 'OVERRIDE_ON_NON_OVERRIDING_GETTER',
3030 "Getter does not override an inherited getter"); 3039 "Getter does not override an inherited getter");
3031 3040
3032 /** 3041 /**
3033 * A method with the override annotation does not override an existing method. 3042 * A method with the override annotation does not override an existing method.
3034 */ 3043 */
3035 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode( 3044 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode(
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
5072 * Initialize a newly created error code to have the given [name]. 5081 * Initialize a newly created error code to have the given [name].
5073 */ 5082 */
5074 const TodoCode(String name) : super(name, "{0}"); 5083 const TodoCode(String name) : super(name, "{0}");
5075 5084
5076 @override 5085 @override
5077 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5086 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5078 5087
5079 @override 5088 @override
5080 ErrorType get type => ErrorType.TODO; 5089 ErrorType get type => ErrorType.TODO;
5081 } 5090 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698