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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 1969063002: copy TypeName.type when we clone the AST (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/compiler/reify_coercions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index 95dba1cdabaa92703a3e0c6a11ea8fa81638d0fa..01751f37aaa30487ca1b2ae26d44665b6bec423d 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -519,8 +519,12 @@ class CodeGenerator extends GeneralizingAstVisitor
@override
JS.Expression visitTypeName(TypeName node) {
- // TODO(jmesserly): should only happen for erroneous code.
- if (node.type == null) return js.call('dart.dynamic');
+ if (node.type == null) {
+ // TODO(jmesserly): if the type fails to resolve, should we generate code
+ // that throws instead?
+ assert(options.unsafeForceCompile);
+ return js.call('dart.dynamic');
vsm 2016/05/11 17:26:07 Throw sounds better to me. Do we need this to run
Jennifer Messerly 2016/05/11 17:52:32 yeah i filed https://github.com/dart-lang/dev_comp
+ }
return _emitType(node.type);
}
@@ -2560,8 +2564,6 @@ class CodeGenerator extends GeneralizingAstVisitor
} else if (typeArgs != null) {
// Dynamic calls may have type arguments, even though the function types
// are not known.
- // TODO(jmesserly): seems to be mostly broken in Analyzer at the moment:
- // https://github.com/dart-lang/sdk/issues/26368
return typeArgs.arguments.map(visitTypeName).toList(growable: false);
}
return null;
« no previous file with comments | « no previous file | lib/src/compiler/reify_coercions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698