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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/optype.dart

Issue 2013123002: Guard against unresolved code (issue 26545) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Handle is case 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/dart/optype.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
index 3a5608c856cbf96ea93e7c24f9976d170a1eca13..ea97679577cae9f42325d362da95c296d5143088 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/optype.dart
@@ -211,8 +211,9 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
optype.includeTypeNameSuggestions = true;
optype.typeNameSuggestionsFilter = (DartType dartType, int relevance) {
DartType staticType = node.expression.staticType;
- if (staticType.isDynamic ||
- (dartType.isSubtypeOf(staticType) && dartType != staticType)) {
+ if (staticType != null &&
+ (staticType.isDynamic ||
+ (dartType.isSubtypeOf(staticType) && dartType != staticType))) {
return relevance;
} else {
return null;
@@ -592,8 +593,9 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
optype.includeTypeNameSuggestions = true;
optype.typeNameSuggestionsFilter = (DartType dartType, int relevance) {
DartType staticType = node.expression.staticType;
- if (staticType.isDynamic ||
- (dartType.isSubtypeOf(staticType) && dartType != staticType)) {
+ if (staticType != null &&
+ (staticType.isDynamic ||
+ (dartType.isSubtypeOf(staticType) && dartType != staticType))) {
return relevance;
} else {
return null;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698