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

Side by Side Diff: pkg/analyzer/lib/src/dart/constant/utilities.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.dart.constant.utilities; 5 library analyzer.src.dart.constant.utilities;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 super.visitRedirectingConstructorInvocation(node); 283 super.visitRedirectingConstructorInvocation(node);
284 ConstructorElement target = getConstructorImpl(node.staticElement); 284 ConstructorElement target = getConstructorImpl(node.staticElement);
285 if (target != null) { 285 if (target != null) {
286 _callback(target); 286 _callback(target);
287 } 287 }
288 return null; 288 return null;
289 } 289 }
290 290
291 @override 291 @override
292 Object visitSimpleIdentifier(SimpleIdentifier node) { 292 Object visitSimpleIdentifier(SimpleIdentifier node) {
293 Element element = node.staticElement; 293 Element staticElement = node.staticElement;
294 if (element is PropertyAccessorElement) { 294 Element element = staticElement is PropertyAccessorElement
295 element = (element as PropertyAccessorElement).variable; 295 ? staticElement.variable
296 } 296 : staticElement;
297 if (element is VariableElement && element.isConst) { 297 if (element is VariableElement && element.isConst) {
298 _callback(element); 298 _callback(element);
299 } 299 }
300 return null; 300 return null;
301 } 301 }
302 302
303 @override 303 @override
304 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { 304 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
305 super.visitSuperConstructorInvocation(node); 305 super.visitSuperConstructorInvocation(node);
306 ConstructorElement constructor = getConstructorImpl(node.staticElement); 306 ConstructorElement constructor = getConstructorImpl(node.staticElement);
307 if (constructor != null) { 307 if (constructor != null) {
308 _callback(constructor); 308 _callback(constructor);
309 } 309 }
310 return null; 310 return null;
311 } 311 }
312 } 312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698