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

Side by Side Diff: pkg/analyzer/lib/src/generated/type_system.dart

Issue 2833073002: Stoppp using trippple consonants (Closed)
Patch Set: More spolling Created 3 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
« no previous file with comments | « pkg/analyzer/CHANGELOG.md ('k') | pkg/compiler/lib/src/diagnostics/messages.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) 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.generated.type_system; 5 library analyzer.src.generated.type_system;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart' show AstNode; 10 import 'package:analyzer/dart/ast/ast.dart' show AstNode;
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 798
799 /** 799 /**
800 * This currently does not implement a very complete least upper bound 800 * This currently does not implement a very complete least upper bound
801 * algorithm, but handles a couple of the very common cases that are 801 * algorithm, but handles a couple of the very common cases that are
802 * causing pain in real code. The current algorithm is: 802 * causing pain in real code. The current algorithm is:
803 * 1. If either of the types is a supertype of the other, return it. 803 * 1. If either of the types is a supertype of the other, return it.
804 * This is in fact the best result in this case. 804 * This is in fact the best result in this case.
805 * 2. If the two types have the same class element, then take the 805 * 2. If the two types have the same class element, then take the
806 * pointwise least upper bound of the type arguments. This is again 806 * pointwise least upper bound of the type arguments. This is again
807 * the best result, except that the recursive calls may not return 807 * the best result, except that the recursive calls may not return
808 * the true least uppper bounds. The result is guaranteed to be a 808 * the true least upper bounds. The result is guaranteed to be a
809 * well-formed type under the assumption that the input types were 809 * well-formed type under the assumption that the input types were
810 * well-formed (and assuming that the recursive calls return 810 * well-formed (and assuming that the recursive calls return
811 * well-formed types). 811 * well-formed types).
812 * 3. Otherwise return the spec-defined least upper bound. This will 812 * 3. Otherwise return the spec-defined least upper bound. This will
813 * be an upper bound, might (or might not) be least, and might 813 * be an upper bound, might (or might not) be least, and might
814 * (or might not) be a well-formed type. 814 * (or might not) be a well-formed type.
815 * 815 *
816 * TODO(leafp): Use matchTypes or something similar here to handle the 816 * TODO(leafp): Use matchTypes or something similar here to handle the
817 * case where one of the types is a superclass (but not supertype) of 817 * case where one of the types is a superclass (but not supertype) of
818 * the other, e.g. LUB(Iterable<double>, List<int>) = Iterable<num> 818 * the other, e.g. LUB(Iterable<double>, List<int>) = Iterable<num>
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 if (type is InterfaceTypeImpl) { 2368 if (type is InterfaceTypeImpl) {
2369 return type.typeArguments.any(isUnknown); 2369 return type.typeArguments.any(isUnknown);
2370 } 2370 }
2371 if (type is FunctionType) { 2371 if (type is FunctionType) {
2372 return isUnknown(type.returnType) || 2372 return isUnknown(type.returnType) ||
2373 type.parameters.any((p) => isUnknown(p.type)); 2373 type.parameters.any((p) => isUnknown(p.type));
2374 } 2374 }
2375 return false; 2375 return false;
2376 } 2376 }
2377 } 2377 }
OLDNEW
« no previous file with comments | « pkg/analyzer/CHANGELOG.md ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698