Index: pkg/analyzer/lib/src/generated/error_verifier.dart |
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart |
index 4a0fae048a9b5d52d369dce498b39be98cead620..0ed89234d0e01b379258ca9c79ddda0e9057bcc9 100644 |
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart |
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart |
@@ -864,7 +864,9 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
Expression target = node.realTarget; |
SimpleIdentifier methodName = node.methodName; |
if (target != null) { |
- ClassElement typeReference = ElementResolver.getTypeReference(target); |
+ bool isConditional = node.operator.type == sc.TokenType.QUESTION_PERIOD; |
+ ClassElement typeReference = |
+ ElementResolver.getTypeReference(target, isConditional); |
_checkForStaticAccessToInstanceMember(typeReference, methodName); |
_checkForInstanceAccessToStaticMember(typeReference, methodName); |
} else { |
@@ -901,7 +903,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
Object visitPrefixedIdentifier(PrefixedIdentifier node) { |
if (node.parent is! Annotation) { |
ClassElement typeReference = |
- ElementResolver.getTypeReference(node.prefix); |
+ ElementResolver.getTypeReference(node.prefix, false); |
SimpleIdentifier name = node.identifier; |
_checkForStaticAccessToInstanceMember(typeReference, name); |
_checkForInstanceAccessToStaticMember(typeReference, name); |
@@ -924,8 +926,9 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
@override |
Object visitPropertyAccess(PropertyAccess node) { |
+ bool isConditional = node.operator.type == sc.TokenType.QUESTION_PERIOD; |
ClassElement typeReference = |
- ElementResolver.getTypeReference(node.realTarget); |
+ ElementResolver.getTypeReference(node.realTarget, isConditional); |
SimpleIdentifier propertyName = node.propertyName; |
_checkForStaticAccessToInstanceMember(typeReference, propertyName); |
_checkForInstanceAccessToStaticMember(typeReference, propertyName); |