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

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

Issue 1917203002: Remove more type casts (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return hashCode; 136 return hashCode;
137 } 137 }
138 138
139 /** 139 /**
140 * Return the message to be displayed for this error. The message should 140 * Return the message to be displayed for this error. The message should
141 * indicate what is wrong and why it is wrong. 141 * indicate what is wrong and why it is wrong.
142 */ 142 */
143 String get message => _message; 143 String get message => _message;
144 144
145 @override 145 @override
146 bool operator ==(Object obj) { 146 bool operator ==(Object other) {
147 if (identical(obj, this)) { 147 if (identical(other, this)) {
148 return true; 148 return true;
149 } 149 }
150 // prepare other AnalysisError 150 // prepare other AnalysisError
151 if (obj is! AnalysisError) { 151 if (other is AnalysisError) {
152 return false; 152 // Quick checks.
153 if (!identical(errorCode, other.errorCode)) {
154 return false;
155 }
156 if (offset != other.offset || length != other.length) {
157 return false;
158 }
159 if (isStaticOnly != other.isStaticOnly) {
160 return false;
161 }
162 // Deep checks.
163 if (_message != other._message) {
164 return false;
165 }
166 if (source != other.source) {
167 return false;
168 }
169 // OK
170 return true;
153 } 171 }
154 AnalysisError other = obj as AnalysisError; 172 return false;
155 // Quick checks.
156 if (!identical(errorCode, other.errorCode)) {
157 return false;
158 }
159 if (offset != other.offset || length != other.length) {
160 return false;
161 }
162 if (isStaticOnly != other.isStaticOnly) {
163 return false;
164 }
165 // Deep checks.
166 if (_message != other._message) {
167 return false;
168 }
169 if (source != other.source) {
170 return false;
171 }
172 // OK
173 return true;
174 } 173 }
175 174
176 /** 175 /**
177 * Return the value of the given [property], or `null` if the given property 176 * Return the value of the given [property], or `null` if the given property
178 * is not defined for this error. 177 * is not defined for this error.
179 */ 178 */
180 Object/*=V*/ getProperty/*<V>*/(ErrorProperty/*<V>*/ property) => null; 179 Object/*=V*/ getProperty/*<V>*/(ErrorProperty/*<V>*/ property) => null;
181 180
182 @override 181 @override
183 String toString() { 182 String toString() {
(...skipping 5626 matching lines...) Expand 10 before | Expand all | Expand 10 after
5810 * Initialize a newly created error code to have the given [name]. 5809 * Initialize a newly created error code to have the given [name].
5811 */ 5810 */
5812 const TodoCode(String name) : super(name, "{0}"); 5811 const TodoCode(String name) : super(name, "{0}");
5813 5812
5814 @override 5813 @override
5815 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 5814 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
5816 5815
5817 @override 5816 @override
5818 ErrorType get type => ErrorType.TODO; 5817 ErrorType get type => ErrorType.TODO;
5819 } 5818 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698