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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart

Issue 17544003: Version 0.5.20.4. (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/simple_inferrer_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 simple_types_inferrer; 5 library simple_types_inferrer;
6 6
7 import 'dart:collection' show Queue, LinkedHashSet; 7 import 'dart:collection' show Queue, LinkedHashSet;
8 8
9 import '../closure.dart' show ClosureClassMap, ClosureScope; 9 import '../closure.dart' show ClosureClassMap, ClosureScope;
10 import '../dart_types.dart' 10 import '../dart_types.dart'
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 } else { 784 } else {
785 assert(element.isGetter()); 785 assert(element.isGetter());
786 return returnTypeOfElement(element); 786 return returnTypeOfElement(element);
787 } 787 }
788 } else if (selector.isIndex() 788 } else if (selector.isIndex()
789 && selector.mask != null 789 && selector.mask != null
790 && selector.mask.isContainer) { 790 && selector.mask.isContainer) {
791 ContainerTypeMask mask = selector.mask; 791 ContainerTypeMask mask = selector.mask;
792 TypeMask elementType = mask.elementType; 792 TypeMask elementType = mask.elementType;
793 return elementType == null ? dynamicType : elementType; 793 return elementType == null ? dynamicType : elementType;
794 } else if (element.isGetter()) {
795 // Closure call.
796 assert(selector.isCall());
797 return dynamicType;
794 } else { 798 } else {
795 return returnTypeOfElement(element); 799 return returnTypeOfElement(element);
796 } 800 }
797 } 801 }
798 802
799 bool isNotClosure(Element element) { 803 bool isNotClosure(Element element) {
800 // If the outermost enclosing element of [element] is [element] 804 // If the outermost enclosing element of [element] is [element]
801 // itself, we know it cannot be a closure. 805 // itself, we know it cannot be a closure.
802 Element outermost = element.getOutermostEnclosingMemberOrTopLevel(); 806 Element outermost = element.getOutermostEnclosingMemberOrTopLevel();
803 return outermost.declaration == element.declaration; 807 return outermost.declaration == element.declaration;
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 } 1940 }
1937 1941
1938 handlePlainAssignment(identifier, element, selector, 1942 handlePlainAssignment(identifier, element, selector,
1939 receiverType, currentType, 1943 receiverType, currentType,
1940 node.expression); 1944 node.expression);
1941 return handleLoop(node, () { 1945 return handleLoop(node, () {
1942 visit(node.body); 1946 visit(node.body);
1943 }); 1947 });
1944 } 1948 }
1945 } 1949 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js/simple_inferrer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698