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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 24211003: Let the inferrer know that lazy variables can also be null incase their initializer throws. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element get currentElement; 8 Element get currentElement;
9 Set<Node> get superUses; 9 Set<Node> get superUses;
10 10
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 } 447 }
448 ResolverVisitor visitor = visitorFor(element); 448 ResolverVisitor visitor = visitorFor(element);
449 visitor.useElement(tree, element); 449 visitor.useElement(tree, element);
450 450
451 // TODO(johnniwinther): Avoid analyzing initializers if 451 // TODO(johnniwinther): Avoid analyzing initializers if
452 // [Compiler.analyzeSignaturesOnly] is set. 452 // [Compiler.analyzeSignaturesOnly] is set.
453 initializerDo(tree, visitor.visit); 453 initializerDo(tree, visitor.visit);
454 454
455 if (Elements.isStaticOrTopLevelField(element)) { 455 if (Elements.isStaticOrTopLevelField(element)) {
456 if (tree.asSendSet() != null) { 456 if (tree.asSendSet() != null) {
457 // TODO(ngeoffray): We could do better here by using the 457 // TODO(13429): We could do better here by using the
458 // constant handler to figure out if it's a lazy field or not. 458 // constant handler to figure out if it's a lazy field or not.
459 compiler.backend.registerLazyField(visitor.mapping); 459 compiler.backend.registerLazyField(visitor.mapping);
460 } else { 460 } else {
461 compiler.enqueuer.resolution.registerInstantiatedClass( 461 compiler.enqueuer.resolution.registerInstantiatedClass(
462 compiler.nullClass, visitor.mapping); 462 compiler.nullClass, visitor.mapping);
463 } 463 }
464 } 464 }
465 465
466 // Perform various checks as side effect of "computing" the type. 466 // Perform various checks as side effect of "computing" the type.
467 element.computeType(compiler); 467 element.computeType(compiler);
(...skipping 3874 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 return e; 4342 return e;
4343 } 4343 }
4344 4344
4345 /// Assumed to be called by [resolveRedirectingFactory]. 4345 /// Assumed to be called by [resolveRedirectingFactory].
4346 Element visitReturn(Return node) { 4346 Element visitReturn(Return node) {
4347 Node expression = node.expression; 4347 Node expression = node.expression;
4348 return finishConstructorReference(visit(expression), 4348 return finishConstructorReference(visit(expression),
4349 expression, expression); 4349 expression, expression);
4350 } 4350 }
4351 } 4351 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698