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

Side by Side Diff: pkg/analyzer/lib/src/task/strong_mode.dart

Issue 1301333007: (TBR) Remove use of null-aware operator until analyzer can require 1.12 (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.task.strong_mode; 5 library analyzer.src.task.strong_mode;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (overriddenMethods.isEmpty || !_onlyMethods(overriddenMethods)) { 388 if (overriddenMethods.isEmpty || !_onlyMethods(overriddenMethods)) {
389 return; 389 return;
390 } 390 }
391 MethodElementImpl element = methodElement as MethodElementImpl; 391 MethodElementImpl element = methodElement as MethodElementImpl;
392 _setReturnType(element, _computeReturnType(overriddenMethods)); 392 _setReturnType(element, _computeReturnType(overriddenMethods));
393 } 393 }
394 // 394 //
395 // Infer the parameter types. 395 // Infer the parameter types.
396 // 396 //
397 List<ParameterElement> parameters = methodElement.parameters; 397 List<ParameterElement> parameters = methodElement.parameters;
398 var length = parameters.length; 398 int length = parameters.length;
399 for (int i = 0; i < length; ++i) { 399 for (int i = 0; i < length; ++i) {
400 ParameterElement parameter = parameters[i]; 400 ParameterElement parameter = parameters[i];
401 if (parameter is ParameterElementImpl && parameter.hasImplicitType) { 401 if (parameter is ParameterElementImpl && parameter.hasImplicitType) {
402 overriddenMethods = overriddenMethods ?? 402 if (overriddenMethods == null) {
403 inheritanceManager.lookupOverrides( 403 overriddenMethods = inheritanceManager.lookupOverrides(
404 methodElement.enclosingElement, methodElement.name); 404 methodElement.enclosingElement, methodElement.name);
405 }
405 if (overriddenMethods.isEmpty || !_onlyMethods(overriddenMethods)) { 406 if (overriddenMethods.isEmpty || !_onlyMethods(overriddenMethods)) {
406 return; 407 return;
407 } 408 }
408 parameter.type = _computeParameterType(parameter, i, overriddenMethods); 409 parameter.type = _computeParameterType(parameter, i, overriddenMethods);
409 } 410 }
410 } 411 }
411 } 412 }
412 413
413 /** 414 /**
414 * Infer type information for all of the instance members in the given 415 * Infer type information for all of the instance members in the given
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 results.add(element); 538 results.add(element);
538 } 539 }
539 } 540 }
540 } 541 }
541 } 542 }
542 543
543 /** 544 /**
544 * A class of exception that is not used anywhere else. 545 * A class of exception that is not used anywhere else.
545 */ 546 */
546 class _CycleException implements Exception {} 547 class _CycleException implements Exception {}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698