Index: pkg/analyzer/test/generated/resolver_test.dart |
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart |
index fa4338d94762abdcea34eb0a568bf1fa1ddbd028..ca7923f9346b5e20408e37995fc20c684b08314d 100644 |
--- a/pkg/analyzer/test/generated/resolver_test.dart |
+++ b/pkg/analyzer/test/generated/resolver_test.dart |
@@ -1421,6 +1421,47 @@ class ElementResolverTest extends EngineTestCase { |
_listener.assertNoErrors(); |
} |
+ void test_visitCommentReference_prefixedIdentifier_class_getter() { |
+ ClassElementImpl classA = ElementFactory.classElement2("A"); |
+ // set accessors |
+ String propName = "p"; |
+ PropertyAccessorElement getter = |
+ ElementFactory.getterElement(propName, false, _typeProvider.intType); |
+ PropertyAccessorElement setter = |
+ ElementFactory.setterElement(propName, false, _typeProvider.intType); |
+ classA.accessors = <PropertyAccessorElement>[getter, setter]; |
+ // set name scope |
+ _visitor.nameScope = new EnclosedScope(null) |
+ ..defineNameWithoutChecking('A', classA); |
+ // prepare "A.p" |
+ PrefixedIdentifier prefixed = AstFactory.identifier5('A', 'p'); |
+ CommentReference commentReference = new CommentReference(null, prefixed); |
+ // resolve |
+ _resolveNode(commentReference); |
+ expect(prefixed.prefix.staticElement, classA); |
+ expect(prefixed.identifier.staticElement, getter); |
+ _listener.assertNoErrors(); |
+ } |
+ |
+ void test_visitCommentReference_prefixedIdentifier_class_method() { |
+ ClassElementImpl classA = ElementFactory.classElement2("A"); |
+ // set method |
+ MethodElement method = |
+ ElementFactory.methodElement("m", _typeProvider.intType); |
+ classA.methods = <MethodElement>[method]; |
+ // set name scope |
+ _visitor.nameScope = new EnclosedScope(null) |
+ ..defineNameWithoutChecking('A', classA); |
+ // prepare "A.m" |
+ PrefixedIdentifier prefixed = AstFactory.identifier5('A', 'm'); |
+ CommentReference commentReference = new CommentReference(null, prefixed); |
+ // resolve |
+ _resolveNode(commentReference); |
+ expect(prefixed.prefix.staticElement, classA); |
+ expect(prefixed.identifier.staticElement, method); |
+ _listener.assertNoErrors(); |
+ } |
+ |
void test_visitConstructorName_named() { |
ClassElementImpl classA = ElementFactory.classElement2("A"); |
String constructorName = "a"; |