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

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

Issue 363113004: Handle unresolved elements in the new IR (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/dart_backend/dart_tree.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart_codegen; 5 library dart_codegen;
6 6
7 import 'dart_tree.dart' as tree; 7 import 'dart_tree.dart' as tree;
8 import 'dart_printer.dart'; 8 import 'dart_printer.dart';
9 import 'dart_tree_printer.dart' show TreePrinter; 9 import 'dart_tree_printer.dart' show TreePrinter;
10 import '../tree/tree.dart' as frontend; 10 import '../tree/tree.dart' as frontend;
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 } else if (type is VoidType) { 547 } else if (type is VoidType) {
548 return new TypeAnnotation('void') 548 return new TypeAnnotation('void')
549 ..dartType = type; 549 ..dartType = type;
550 } else if (type is TypeVariableType) { 550 } else if (type is TypeVariableType) {
551 return new TypeAnnotation(type.name) 551 return new TypeAnnotation(type.name)
552 ..dartType = type; 552 ..dartType = type;
553 } else if (type is DynamicType) { 553 } else if (type is DynamicType) {
554 return new TypeAnnotation("dynamic") 554 return new TypeAnnotation("dynamic")
555 ..dartType = type; 555 ..dartType = type;
556 } else if (type is MalformedType) { 556 } else if (type is MalformedType) {
557 // treat malformed types as dynamic 557 return new TypeAnnotation(type.name)
558 return new TypeAnnotation("dynamic") 558 ..dartType = type;
559 ..dartType = const DynamicType();
560 } else { 559 } else {
561 throw "Unsupported type annotation: $type"; 560 throw "Unsupported type annotation: $type";
562 } 561 }
563 } 562 }
564 563
565 /// Like [emitType] except the dynamic type is converted to null. 564 /// Like [emitType] except the dynamic type is converted to null.
566 TypeAnnotation emitOptionalType(DartType type) { 565 TypeAnnotation emitOptionalType(DartType type) {
567 if (type.treatAsDynamic) { 566 if (type.treatAsDynamic) {
568 return null; 567 return null;
569 } else { 568 } else {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 return new Identifier(name) 639 return new Identifier(name)
641 ..element = exp.element; 640 ..element = exp.element;
642 } 641 }
643 642
644 Expression visitFunction(FunctionConstExp exp) { 643 Expression visitFunction(FunctionConstExp exp) {
645 return new Identifier(exp.element.name) 644 return new Identifier(exp.element.name)
646 ..element = exp.element; 645 ..element = exp.element;
647 } 646 }
648 647
649 } 648 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698