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

Side by Side Diff: lib/compiler/implementation/typechecker.dart

Issue 10908143: Support check mode for statics. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class TypeCheckerTask extends CompilerTask { 5 class TypeCheckerTask extends CompilerTask {
6 TypeCheckerTask(Compiler compiler) : super(compiler); 6 TypeCheckerTask(Compiler compiler) : super(compiler);
7 String get name => "Type checker"; 7 String get name => "Type checker";
8 8
9 static const bool LOG_FAILURES = false; 9 static const bool LOG_FAILURES = false;
10 10
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 Element dynamicElement, 246 Element dynamicElement,
247 LibraryElement library) 247 LibraryElement library)
248 : voidType = new VoidType(new VoidElement(library)), 248 : voidType = new VoidType(new VoidElement(library)),
249 dynamicType = new InterfaceType(dynamicElement); 249 dynamicType = new InterfaceType(dynamicElement);
250 250
251 /** Returns true if t is a subtype of s */ 251 /** Returns true if t is a subtype of s */
252 bool isSubtype(DartType t, DartType s) { 252 bool isSubtype(DartType t, DartType s) {
253 if (t === s || 253 if (t === s ||
254 t === dynamicType || 254 t === dynamicType ||
255 s === dynamicType || 255 s === dynamicType ||
256 s.element === compiler.objectClass) { 256 s.element === compiler.objectClass ||
257 t.element === compiler.nullClass) {
257 return true; 258 return true;
258 } 259 }
259 t = t.unalias(compiler); 260 t = t.unalias(compiler);
260 s = s.unalias(compiler); 261 s = s.unalias(compiler);
261 262
262 if (t is VoidType) { 263 if (t is VoidType) {
263 return false; 264 return false;
264 } else if (t is InterfaceType) { 265 } else if (t is InterfaceType) {
265 if (s is !InterfaceType) return false; 266 if (s is !InterfaceType) return false;
266 ClassElement tc = t.element; 267 ClassElement tc = t.element;
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 } 904 }
904 905
905 visitCatchBlock(CatchBlock node) { 906 visitCatchBlock(CatchBlock node) {
906 return unhandledStatement(); 907 return unhandledStatement();
907 } 908 }
908 909
909 visitTypedef(Typedef node) { 910 visitTypedef(Typedef node) {
910 return unhandledStatement(); 911 return unhandledStatement();
911 } 912 }
912 } 913 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698