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

Side by Side Diff: pkg/compiler/lib/src/resolution/resolution.dart

Issue 1422623014: Add TypeUse. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month 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
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 library dart2js.resolution; 5 library dart2js.resolution;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show 10 import '../common/names.dart' show
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 import '../tokens/token.dart' show 42 import '../tokens/token.dart' show
43 isBinaryOperator, 43 isBinaryOperator,
44 isMinusOperator, 44 isMinusOperator,
45 isTernaryOperator, 45 isTernaryOperator,
46 isUnaryOperator, 46 isUnaryOperator,
47 isUserDefinableOperator; 47 isUserDefinableOperator;
48 import '../tree/tree.dart'; 48 import '../tree/tree.dart';
49 import '../universe/call_structure.dart' show 49 import '../universe/call_structure.dart' show
50 CallStructure; 50 CallStructure;
51 import '../universe/use.dart' show 51 import '../universe/use.dart' show
52 StaticUse; 52 StaticUse,
53 TypeUse;
53 import '../universe/world_impact.dart' show 54 import '../universe/world_impact.dart' show
54 WorldImpact; 55 WorldImpact;
55 import '../util/util.dart' show 56 import '../util/util.dart' show
56 Link, 57 Link,
57 LinkBuilder, 58 LinkBuilder,
58 Setlet; 59 Setlet;
59 60
60 import 'class_hierarchy.dart'; 61 import 'class_hierarchy.dart';
61 import 'class_members.dart' show MembersCreator; 62 import 'class_members.dart' show MembersCreator;
62 import 'constructors.dart'; 63 import 'constructors.dart';
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 // TODO(johnniwinther): Avoid analyzing initializers if 371 // TODO(johnniwinther): Avoid analyzing initializers if
371 // [Compiler.analyzeSignaturesOnly] is set. 372 // [Compiler.analyzeSignaturesOnly] is set.
372 visitor.visit(initializer); 373 visitor.visit(initializer);
373 } else if (modifiers.isConst) { 374 } else if (modifiers.isConst) {
374 reporter.reportErrorMessage( 375 reporter.reportErrorMessage(
375 element, MessageKind.CONST_WITHOUT_INITIALIZER); 376 element, MessageKind.CONST_WITHOUT_INITIALIZER);
376 } else if (modifiers.isFinal && !element.isInstanceMember) { 377 } else if (modifiers.isFinal && !element.isInstanceMember) {
377 reporter.reportErrorMessage( 378 reporter.reportErrorMessage(
378 element, MessageKind.FINAL_WITHOUT_INITIALIZER); 379 element, MessageKind.FINAL_WITHOUT_INITIALIZER);
379 } else { 380 } else {
380 registry.registerInstantiatedType(coreTypes.nullType); 381 // TODO(johnniwinther): Register a feature instead.
382 registry.registerTypeUse(new TypeUse.instantiation(coreTypes.nullType));
381 } 383 }
382 384
383 if (Elements.isStaticOrTopLevelField(element)) { 385 if (Elements.isStaticOrTopLevelField(element)) {
384 visitor.addDeferredAction(element, () { 386 visitor.addDeferredAction(element, () {
385 if (element.modifiers.isConst) { 387 if (element.modifiers.isConst) {
386 element.constant = constantCompiler.compileConstant(element); 388 element.constant = constantCompiler.compileConstant(element);
387 } else { 389 } else {
388 constantCompiler.compileVariable(element); 390 constantCompiler.compileVariable(element);
389 } 391 }
390 }); 392 });
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 TreeElements get treeElements { 1091 TreeElements get treeElements {
1090 assert(invariant(this, _treeElements !=null, 1092 assert(invariant(this, _treeElements !=null,
1091 message: "TreeElements have not been computed for $this.")); 1093 message: "TreeElements have not been computed for $this."));
1092 return _treeElements; 1094 return _treeElements;
1093 } 1095 }
1094 1096
1095 void reuseElement() { 1097 void reuseElement() {
1096 _treeElements = null; 1098 _treeElements = null;
1097 } 1099 }
1098 } 1100 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698