| 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 c27b507966ad4b9aa95a6e4f46393425ad423045..0e06726623350456c2e4bb44cb4d6edb0db0c310 100644
|
| --- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
|
| +++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
|
| @@ -371,6 +371,7 @@ class ResynthTest extends ResolverTestCase {
|
| PropertyInducingElementImpl original,
|
| String desc) {
|
| compareVariableElements(resynthesized, original, desc);
|
| + compareTypes(resynthesized.propagatedType, original.propagatedType, desc);
|
| if (original.getter == null) {
|
| expect(resynthesized.getter, isNull);
|
| } else {
|
| @@ -487,10 +488,68 @@ class ResynthTest extends ResolverTestCase {
|
| // TODO(paulberry): test initializer
|
| }
|
|
|
| + fail_field_propagatedType_const_noDep() {
|
| + checkLibrary('''
|
| +class C {
|
| + static const x = 0;
|
| +}''');
|
| + }
|
| +
|
| + fail_field_propagatedType_final_dep_inLib() {
|
| + addNamedSource('/a.dart', 'final a = 1;');
|
| + checkLibrary('''
|
| +import "a.dart";
|
| +class C {
|
| + final b = a / 2;
|
| +}''');
|
| + }
|
| +
|
| + fail_field_propagatedType_final_dep_inPart() {
|
| + addNamedSource('/a.dart', 'part of lib; final a = 1;');
|
| + checkLibrary('''
|
| +library lib;
|
| +part "a.dart";
|
| +class C {
|
| + final b = a / 2;
|
| +}''');
|
| + }
|
| +
|
| + fail_field_propagatedType_final_noDep_instance() {
|
| + checkLibrary('''
|
| +class C {
|
| + final x = 0;
|
| +}''');
|
| + }
|
| +
|
| + fail_field_propagatedType_final_noDep_static() {
|
| + checkLibrary('''
|
| +class C {
|
| + static final x = 0;
|
| +}''');
|
| + }
|
| +
|
| fail_library_hasExtUri() {
|
| checkLibrary('import "dart-ext:doesNotExist.dart";');
|
| }
|
|
|
| + fail_variable_propagatedType_const_noDep() {
|
| + checkLibrary('const i = 0;');
|
| + }
|
| +
|
| + fail_variable_propagatedType_final_dep_inLib() {
|
| + addNamedSource('/a.dart', 'final a = 1;');
|
| + checkLibrary('import "a.dart"; final b = a / 2;');
|
| + }
|
| +
|
| + fail_variable_propagatedType_final_dep_inPart() {
|
| + addNamedSource('/a.dart', 'part of lib; final a = 1;');
|
| + checkLibrary('library lib; part "a.dart"; final b = a / 2;');
|
| + }
|
| +
|
| + fail_variable_propagatedType_final_noDep() {
|
| + checkLibrary('final i = 0;');
|
| + }
|
| +
|
| LibraryElementImpl resynthesizeLibrary(
|
| Source source, LibraryElementImpl original, bool allowErrors,
|
| {int resynthesisCount: 1}) {
|
|
|