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

Side by Side Diff: pkg/analyzer/lib/src/dart/resolver/scope.dart

Issue 1918923003: Remove unnecessary casts and general code clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: clean-up Created 4 years, 8 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.resolver.scope; 5 library analyzer.src.dart.resolver.scope;
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/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 Element element = nameSpace.get(name); 383 Element element = nameSpace.get(name);
384 if (element != null) { 384 if (element != null) {
385 if (foundElement == null) { 385 if (foundElement == null) {
386 foundElement = element; 386 foundElement = element;
387 } else if (!identical(foundElement, element)) { 387 } else if (!identical(foundElement, element)) {
388 foundElement = MultiplyDefinedElementImpl.fromElements( 388 foundElement = MultiplyDefinedElementImpl.fromElements(
389 _definingLibrary.context, foundElement, element); 389 _definingLibrary.context, foundElement, element);
390 } 390 }
391 } 391 }
392 } 392 }
393 if (foundElement is MultiplyDefinedElementImpl) { 393 Element element = foundElement;
394 foundElement = _removeSdkElements( 394 if (element is MultiplyDefinedElementImpl) {
395 identifier, name, foundElement as MultiplyDefinedElementImpl); 395 foundElement = _removeSdkElements(identifier, name, element);
396 } 396 }
397 if (foundElement is MultiplyDefinedElementImpl) { 397 if (foundElement is MultiplyDefinedElementImpl) {
398 String foundEltName = foundElement.displayName; 398 String foundEltName = foundElement.displayName;
399 List<Element> conflictingMembers = foundElement.conflictingElements; 399 List<Element> conflictingMembers = foundElement.conflictingElements;
400 int count = conflictingMembers.length; 400 int count = conflictingMembers.length;
401 List<String> libraryNames = new List<String>(count); 401 List<String> libraryNames = new List<String>(count);
402 for (int i = 0; i < count; i++) { 402 for (int i = 0; i < count; i++) {
403 libraryNames[i] = _getLibraryName(conflictingMembers[i]); 403 libraryNames[i] = _getLibraryName(conflictingMembers[i]);
404 } 404 }
405 libraryNames.sort(); 405 libraryNames.sort();
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 1050
1051 /** 1051 /**
1052 * Define the type parameters declared by the [classElement]. 1052 * Define the type parameters declared by the [classElement].
1053 */ 1053 */
1054 void _defineTypeParameters(ClassElement classElement) { 1054 void _defineTypeParameters(ClassElement classElement) {
1055 for (TypeParameterElement typeParameter in classElement.typeParameters) { 1055 for (TypeParameterElement typeParameter in classElement.typeParameters) {
1056 define(typeParameter); 1056 define(typeParameter);
1057 } 1057 }
1058 } 1058 }
1059 } 1059 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/resolver/inheritance_manager.dart ('k') | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698