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

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

Issue 15743003: Fix static warnings spotted by dartc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | sdk/lib/_internal/compiler/implementation/types/union_type_mask.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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 764
765 765
766 /** 766 /**
767 * Returns the type of [element]. Returns [:dynamic:] if 767 * Returns the type of [element]. Returns [:dynamic:] if
768 * [element] has not been analyzed yet. 768 * [element] has not been analyzed yet.
769 */ 769 */
770 TypeMask typeOfElement(Element element) { 770 TypeMask typeOfElement(Element element) {
771 element = element.implementation; 771 element = element.implementation;
772 if (isNativeElement(element) && element.isField()) { 772 if (isNativeElement(element) && element.isField()) {
773 var type = typeOf.putIfAbsent(element, () { 773 var type = typeOf.putIfAbsent(element, () {
774 InterfaceType type = element.computeType(compiler).asRaw(); 774 InterfaceType rawType = element.computeType(compiler).asRaw();
775 return type.isDynamic ? dynamicType : new TypeMask.subtype(type); 775 return rawType.isDynamic ? dynamicType : new TypeMask.subtype(rawType);
776 }); 776 });
777 assert(type != null); 777 assert(type != null);
778 return type; 778 return type;
779 } 779 }
780 TypeMask type = typeOf[element]; 780 TypeMask type = typeOf[element];
781 if (type == null) { 781 if (type == null) {
782 if ((compiler.trustTypeAnnotations 782 if ((compiler.trustTypeAnnotations
783 && (element.isField() 783 && (element.isField()
784 || element.isParameter() 784 || element.isParameter()
785 || element.isVariable())) 785 || element.isVariable()))
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 } else { 2617 } else {
2618 result.merge(locals, discardIfAborts: false); 2618 result.merge(locals, discardIfAborts: false);
2619 } 2619 }
2620 } 2620 }
2621 locals = result; 2621 locals = result;
2622 } 2622 }
2623 clearBreaksAndContinues(elements[node]); 2623 clearBreaksAndContinues(elements[node]);
2624 return inferrer.dynamicType; 2624 return inferrer.dynamicType;
2625 } 2625 }
2626 } 2626 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698