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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1716873002: Test resynthesis of initializer of parameter elements and variable members. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index 65f83b5520cb8a329c0c42a8822146e70f47fd4a..90b2c2e569a14ab7bb43dca74624a2044b4da26f 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -806,6 +806,11 @@ class ResynthTest extends ResolverTestCase {
}
expect(resynthesized.defaultValueCode, original.defaultValueCode,
reason: desc);
+ ParameterElementImpl resynthesizedActual =
+ getActualElement(resynthesized, desc);
+ ParameterElementImpl originalActual = getActualElement(original, desc);
+ compareFunctionElements(
+ resynthesizedActual.initializer, originalActual.initializer, desc);
}
void comparePrefixElements(PrefixElementImpl resynthesized,
@@ -949,20 +954,17 @@ class ResynthTest extends ResolverTestCase {
VariableElement resynthesized, VariableElement original, String desc) {
compareElements(resynthesized, original, desc);
compareTypes(resynthesized.type, original.type, desc);
- // TODO(scheglov) VariableMember.initializer is not implemented
- if (original is! VariableMember) {
- compareFunctionElements(
- resynthesized.initializer, original.initializer, desc);
- }
+ VariableElementImpl resynthesizedActual =
+ getActualElement(resynthesized, desc);
VariableElementImpl originalActual = getActualElement(original, desc);
+ compareFunctionElements(
+ resynthesizedActual.initializer, originalActual.initializer, desc);
if (originalActual is ConstVariableElement) {
Element oEnclosing = original.enclosingElement;
if (oEnclosing is ClassElement && oEnclosing.isEnum) {
compareConstValues(
resynthesized.constantValue, original.constantValue, desc);
} else {
- VariableElementImpl resynthesizedActual =
- getActualElement(resynthesized, desc);
Expression initializer = resynthesizedActual.constantInitializer;
if (constantInitializersAreInvalid) {
_assertUnresolvedIdentifier(initializer, desc);
« 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