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

Side by Side Diff: lib/type_algebra.dart

Issue 2464843002: Fix some strong mode issues. (Closed)
Patch Set: Revert .analysis_options as there are still strong-mode issues Created 4 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 | « lib/transformations/mixin_full_resolution.dart ('k') | test/class_hierarchy_basic.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library kernel.type_algebra; 4 library kernel.type_algebra;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 7
8 /// Returns a type where all occurrences of the given type parameters have been 8 /// Returns a type where all occurrences of the given type parameters have been
9 /// replaced with the corresponding types. 9 /// replaced with the corresponding types.
10 /// 10 ///
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 int depth = 0; 355 int depth = 0;
356 bool isInfinite = false; 356 bool isInfinite = false;
357 357
358 _DeepTypeSubstitutor(Map<TypeParameter, DartType> substitution, 358 _DeepTypeSubstitutor(Map<TypeParameter, DartType> substitution,
359 [_DeepTypeSubstitutor outer]) 359 [_DeepTypeSubstitutor outer])
360 : super(outer) { 360 : super(outer) {
361 this.substitution.addAll(substitution); 361 this.substitution.addAll(substitution);
362 } 362 }
363 363
364 @override 364 @override
365 _TypeSubstitutor newInnerEnvironment() { 365 _DeepTypeSubstitutor newInnerEnvironment() {
366 return new _DeepTypeSubstitutor(<TypeParameter, DartType>{}, this); 366 return new _DeepTypeSubstitutor(<TypeParameter, DartType>{}, this);
367 } 367 }
368 368
369 @override 369 @override
370 DartType visitTypeParameterType(TypeParameterType node) { 370 DartType visitTypeParameterType(TypeParameterType node) {
371 DartType replacement = getSubstitute(node.parameter); 371 DartType replacement = getSubstitute(node.parameter);
372 if (replacement == null) return node; 372 if (replacement == null) return node;
373 if (isInfinite) return replacement; 373 if (isInfinite) return replacement;
374 ++depth; 374 ++depth;
375 if (depth > substitution.length) { 375 if (depth > substitution.length) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 576 }
577 577
578 Map<dynamic/*=K*/, dynamic/*=W*/ > _mapValues/*<K,V,W>*/( 578 Map<dynamic/*=K*/, dynamic/*=W*/ > _mapValues/*<K,V,W>*/(
579 Map<dynamic/*=K*/, dynamic/*=V*/ > map, dynamic/*=W*/ fn(dynamic/*=V*/)) { 579 Map<dynamic/*=K*/, dynamic/*=V*/ > map, dynamic/*=W*/ fn(dynamic/*=V*/)) {
580 Map<dynamic/*=K*/, dynamic/*=W*/ > result = {}; 580 Map<dynamic/*=K*/, dynamic/*=W*/ > result = {};
581 map.forEach((key, value) { 581 map.forEach((key, value) {
582 result[key] = fn(value); 582 result[key] = fn(value);
583 }); 583 });
584 return result; 584 return result;
585 } 585 }
OLDNEW
« no previous file with comments | « lib/transformations/mixin_full_resolution.dart ('k') | test/class_hierarchy_basic.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698