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

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

Issue 2699073003: Support `void` as generic argument.
Patch Set: Shuffle things around to have a better `voidRti` locality. Created 3 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
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 Identifiers; 10 import '../common/names.dart' show Identifiers;
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 element.computeType(resolution); 434 element.computeType(resolution);
435 435
436 resolution.target.resolveNativeMember(element, registry.impactBuilder); 436 resolution.target.resolveNativeMember(element, registry.impactBuilder);
437 437
438 return registry.impactBuilder; 438 return registry.impactBuilder;
439 }); 439 });
440 } 440 }
441 441
442 ResolutionDartType resolveTypeAnnotation( 442 ResolutionDartType resolveTypeAnnotation(
443 Element element, TypeAnnotation annotation) { 443 Element element, TypeAnnotation annotation) {
444 ResolutionDartType type = _resolveReturnType(element, annotation);
445 if (type.isVoid) {
446 reporter.reportErrorMessage(annotation, MessageKind.VOID_NOT_ALLOWED);
447 }
448 return type;
449 }
450
451 ResolutionDartType _resolveReturnType(
452 Element element, TypeAnnotation annotation) {
453 if (annotation == null) return const ResolutionDynamicType(); 444 if (annotation == null) return const ResolutionDynamicType();
454 ResolutionDartType result = 445 ResolutionDartType result =
455 visitorFor(element).resolveTypeAnnotation(annotation); 446 visitorFor(element).resolveTypeAnnotation(annotation);
456 assert(invariant(annotation, result != null, 447 assert(invariant(annotation, result != null,
457 message: "No type computed for $annotation.")); 448 message: "No type computed for $annotation."));
458 if (result == null) { 449 if (result == null) {
459 // TODO(karklose): warning. 450 // TODO(karklose): warning.
460 return const ResolutionDynamicType(); 451 return const ResolutionDynamicType();
461 } 452 }
462 return result; 453 return result;
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 TreeElements get treeElements { 1134 TreeElements get treeElements {
1144 assert(invariant(this, _treeElements != null, 1135 assert(invariant(this, _treeElements != null,
1145 message: "TreeElements have not been computed for $this.")); 1136 message: "TreeElements have not been computed for $this."));
1146 return _treeElements; 1137 return _treeElements;
1147 } 1138 }
1148 1139
1149 void reuseElement() { 1140 void reuseElement() {
1150 _treeElements = null; 1141 _treeElements = null;
1151 } 1142 }
1152 } 1143 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698