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

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

Issue 13642002: Make sure required type arguments are given when using factories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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/js_backend/emitter.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) 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 dart2js; 5 part of dart2js;
6 6
7 class EnqueueTask extends CompilerTask { 7 class EnqueueTask extends CompilerTask {
8 final ResolutionEnqueuer resolution; 8 final ResolutionEnqueuer resolution;
9 final CodegenEnqueuer codegen; 9 final CodegenEnqueuer codegen;
10 10
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 void registerIsCheck(DartType type, TreeElements elements) { 379 void registerIsCheck(DartType type, TreeElements elements) {
380 // Even in checked mode, type annotations for return type and argument 380 // Even in checked mode, type annotations for return type and argument
381 // types do not imply type checks, so there should never be a check 381 // types do not imply type checks, so there should never be a check
382 // against the type variable of a typedef. 382 // against the type variable of a typedef.
383 assert(type.kind != TypeKind.TYPE_VARIABLE || 383 assert(type.kind != TypeKind.TYPE_VARIABLE ||
384 !type.element.enclosingElement.isTypedef()); 384 !type.element.enclosingElement.isTypedef());
385 universe.isChecks.add(type); 385 universe.isChecks.add(type);
386 compiler.backend.registerIsCheck(type, this, elements); 386 compiler.backend.registerIsCheck(type, this, elements);
387 } 387 }
388 388
389 /**
390 * If a factory constructor is used with type arguments, we lose track
391 * which arguments could be used to create instances of classes that use their
392 * type variables as expressions, so we have to remember if we saw such a use.
393 */
394 void registerFactoryWithTypeArguments(TreeElements elements) {
395 universe.usingFactoryWithTypeArguments = true;
396 }
397
389 void registerAsCheck(DartType type, TreeElements elements) { 398 void registerAsCheck(DartType type, TreeElements elements) {
390 registerIsCheck(type, elements); 399 registerIsCheck(type, elements);
391 compiler.backend.registerAsCheck(type, elements); 400 compiler.backend.registerAsCheck(type, elements);
392 } 401 }
393 402
394 void forEach(f(WorkItem work)); 403 void forEach(f(WorkItem work));
395 404
396 void logSummary(log(message)) { 405 void logSummary(log(message)) {
397 _logSpecificSummary(log); 406 _logSpecificSummary(log);
398 nativeEnqueuer.logSummary(log); 407 nativeEnqueuer.logSummary(log);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 while(!queue.isEmpty) { 572 while(!queue.isEmpty) {
564 // TODO(johnniwinther): Find an optimal process order for codegen. 573 // TODO(johnniwinther): Find an optimal process order for codegen.
565 f(queue.removeLast()); 574 f(queue.removeLast());
566 } 575 }
567 } 576 }
568 577
569 void _logSpecificSummary(log(message)) { 578 void _logSpecificSummary(log(message)) {
570 log('Compiled ${generatedCode.length} methods.'); 579 log('Compiled ${generatedCode.length} methods.');
571 } 580 }
572 } 581 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698