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

Side by Side Diff: lib/type_algebra.dart

Issue 2504313002: Fix some issues after introducing NamedType. (Closed)
Patch Set: Update testcase to cover the missing case 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 | « no previous file | lib/type_checker.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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 bool visitTypeParameterType(TypeParameterType node) { 635 bool visitTypeParameterType(TypeParameterType node) {
636 return variables == null || variables.contains(node.parameter); 636 return variables == null || variables.contains(node.parameter);
637 } 637 }
638 638
639 bool handleTypeParameter(TypeParameter node) { 639 bool handleTypeParameter(TypeParameter node) {
640 assert(!variables.contains(node)); 640 assert(!variables.contains(node));
641 return node.bound.accept(this); 641 return node.bound.accept(this);
642 } 642 }
643 } 643 }
644
645 Map<dynamic/*=K*/, dynamic/*=W*/ > _mapValues/*<K,V,W>*/(
646 Map<dynamic/*=K*/, dynamic/*=V*/ > map, dynamic/*=W*/ fn(dynamic/*=V*/)) {
647 Map<dynamic/*=K*/, dynamic/*=W*/ > result = {};
648 map.forEach((key, value) {
649 result[key] = fn(value);
650 });
651 return result;
652 }
OLDNEW
« no previous file with comments | « no previous file | lib/type_checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698