Skip to content

Commit

Permalink
Updates for passing / failing analysis_server tests.
Browse files Browse the repository at this point in the history
R=brianwilkerson@google.com

Change-Id: Ica615414f567cf62bb631824f95d9ef45b8a777a
Reviewed-on: https://dart-review.googlesource.com/69003
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
scheglov authored and commit-bot@chromium.org committed Aug 8, 2018
1 parent 235ccc9 commit eab4923
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 34 deletions.
8 changes: 0 additions & 8 deletions pkg/analysis_server/test/plugin/protocol_dart_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,6 @@ class ElementTest_UseCFE extends ElementTest {
@override
bool get useCFE => true;

@failingTest
@override
test_fromElement_ENUM() => super.test_fromElement_ENUM();

@failingTest
@override
test_fromElement_ENUM_CONSTANT() => super.test_fromElement_ENUM_CONSTANT();

@failingTest
@override
test_fromElement_LABEL() => super.test_fromElement_LABEL();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4224,10 +4224,6 @@ class LocalConstructorContributorTest_UseCFE
test_DefaultFormalParameter_named_expression() =>
super.test_DefaultFormalParameter_named_expression();

@failingTest
@override
test_enum_deprecated() => super.test_enum_deprecated();

@failingTest
@override
test_ForEachStatement_body_untyped() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4732,10 +4732,6 @@ class LocalReferenceContributorTest_UseCFE
test_DefaultFormalParameter_named_expression() =>
super.test_DefaultFormalParameter_named_expression();

@failingTest
@override
test_enum_deprecated() => super.test_enum_deprecated();

@failingTest
@override
test_enum_filter() => super.test_enum_filter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ class SearchEngineImplTest_UseCFE extends SearchEngineImplTest {

@failingTest
@override
test_searchReferences_discover_owned() =>
super.test_searchReferences_discover_owned();
test_searchReferences_discover_owned() {
return callFailingTest(super.test_searchReferences_discover_owned);
}
}
19 changes: 6 additions & 13 deletions pkg/analyzer/lib/src/generated/declaration_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,25 +185,18 @@ class DeclarationResolver extends RecursiveAstVisitor<Object> {
@override
Object visitEnumDeclaration(EnumDeclaration node) {
ClassElement element = _match(node.name, _walker.getEnum());
if (_useCFE) {
node.name.staticType = _typeProvider.typeType;
for (var constant in node.constants) {
SimpleIdentifier name = constant.name;
FieldElement field = element.getField(name.name);
name.staticElement = field;
name.staticType = element.type;
}
return null;
}
node.name.staticType = _typeProvider.typeType;
resolveMetadata(node, node.metadata, element);
_walk(new ElementWalker.forClass(element), () {
for (EnumConstantDeclaration constant in node.constants) {
VariableElement element = _match(constant.name, _walker.getVariable());
resolveMetadata(node, constant.metadata, element);
VariableElement field = _match(constant.name, _walker.getVariable());
resolveMetadata(node, constant.metadata, field);
constant.name.staticElement = field;
constant.name.staticType = field.type;
}
_walker.getFunction(); // toString()
super.visitEnumDeclaration(node);
});
resolveMetadata(node, node.metadata, element);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8051,9 +8051,7 @@ enum MyEnum {

SimpleIdentifier dName = enumNode.name;
expect(dName.staticElement, same(enumElement));
if (useCFE) {
expect(dName.staticType, typeProvider.typeType);
}
expect(dName.staticType, typeProvider.typeType);

{
var aElement = enumElement.getField('A');
Expand Down

0 comments on commit eab4923

Please sign in to comment.