The exception occurs because the type can be set to null if the element is either a parameter or local variable element. This might be a change since the time this code was originally written.
R=danrubel@google.com Review URL: https://codereview.chromium.org/1688493002 .
This commit is contained in:
@@ -72,7 +72,8 @@ class TypeMemberContributor extends DartCompletionContributor {
|
||||
} else if (elem is LocalVariableElement) {
|
||||
type = elem.type;
|
||||
}
|
||||
if (type.isDynamic && expression is SimpleIdentifier) {
|
||||
if ((type == null || type.isDynamic) &&
|
||||
expression is SimpleIdentifier) {
|
||||
// If the element does not provide a good type
|
||||
// then attempt to get a better type from a local declaration
|
||||
_LocalBestTypeVisitor visitor =
|
||||
|
||||
Reference in New Issue
Block a user