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

Unified Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 924783005: Improve code generation for 'bottom' and 'dynamic' arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
Index: pkg/analysis_server/lib/src/services/correction/util.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 837afd85b65f5a8466b7e8299d91fa1a522a0403..2400e3f32c56680262a90a1ae831811a300906ab 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -934,6 +934,7 @@ class CorrectionUtils {
/**
* Returns the source to reference [type] in this [CompilationUnit].
+ * May return `null` if [type] does not have a source.
*
* Fills [librariesToImport] with [LibraryElement]s whose elements are
* used by the generated source, but not imported.
@@ -944,6 +945,10 @@ class CorrectionUtils {
if (type is FunctionType && type.element is! FunctionTypeAliasElement) {
return "Function";
}
+ // dynamic or BottomType
+ if (type.isDynamic || type.isBottom) {
+ return null;
+ }
// prepare element
Element element = type.element;
if (element == null) {

Powered by Google App Engine
This is Rietveld 408576698