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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_common.dart

Issue 2987863002: Resynthesize factoring constructor redirects from Kernel. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.src.serialization.elements_test; 5 library test.src.serialization.elements_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 5013 matching lines...) Expand 10 before | Expand all | Expand 10 after
5024 var library = await checkLibrary(''' 5024 var library = await checkLibrary('''
5025 class C { 5025 class C {
5026 final x; 5026 final x;
5027 C() : x = new D(); 5027 C() : x = new D();
5028 } 5028 }
5029 class D { 5029 class D {
5030 final x; 5030 final x;
5031 D() : x = new C(); 5031 D() : x = new C();
5032 } 5032 }
5033 '''); 5033 ''');
5034 if (isSharedFrontEnd) { 5034 checkElementText(library, r'''
5035 // The shared front-end keeps initializers for cycled constructors.
5036 checkElementText(library, r'''
5037 class C {
5038 final dynamic x;
5039 C() :
5040 x/*location: test.dart;C;x*/ = new
5041 D/*location: test.dart;D*/();
5042 }
5043 class D {
5044 final dynamic x;
5045 D() :
5046 x/*location: test.dart;D;x*/ = new
5047 C/*location: test.dart;C*/();
5048 }
5049 ''');
5050 } else {
5051 checkElementText(library, r'''
5052 class C { 5035 class C {
5053 final dynamic x; 5036 final dynamic x;
5054 C(); 5037 C();
5055 } 5038 }
5056 class D { 5039 class D {
5057 final dynamic x; 5040 final dynamic x;
5058 D(); 5041 D();
5059 } 5042 }
5060 '''); 5043 ''');
5061 }
5062 } 5044 }
5063 5045
5064 test_defaultValue_refersToGenericClass_constructor() async { 5046 test_defaultValue_refersToGenericClass_constructor() async {
5065 var library = await checkLibrary(''' 5047 var library = await checkLibrary('''
5066 class B<T> { 5048 class B<T> {
5067 const B(); 5049 const B();
5068 } 5050 }
5069 class C<T> { 5051 class C<T> {
5070 const C([B<T> b = const B()]); 5052 const C([B<T> b = const B()]);
5071 } 5053 }
(...skipping 4954 matching lines...) Expand 10 before | Expand all | Expand 10 after
10026 fail('Unexpectedly tried to get unlinked summary for $uri'); 10008 fail('Unexpectedly tried to get unlinked summary for $uri');
10027 } 10009 }
10028 return serializedUnit; 10010 return serializedUnit;
10029 } 10011 }
10030 10012
10031 @override 10013 @override
10032 bool hasLibrarySummary(String uri) { 10014 bool hasLibrarySummary(String uri) {
10033 return true; 10015 return true;
10034 } 10016 }
10035 } 10017 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/kernel/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698