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

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

Issue 2416863003: Fix summarization of closures in toplevel variable declarations in part files. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/constant/value.dart'; 8 import 'package:analyzer/dart/constant/value.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 1628
1629 test_closure_executable_with_return_type_from_closure() { 1629 test_closure_executable_with_return_type_from_closure() {
1630 checkLibrary(''' 1630 checkLibrary('''
1631 f() { 1631 f() {
1632 print(() {}); 1632 print(() {});
1633 print(() => () => 0); 1633 print(() => () => 0);
1634 } 1634 }
1635 '''); 1635 ''');
1636 } 1636 }
1637 1637
1638 test_closure_in_variable_declaration_in_part() {
1639 addSource('/a.dart', 'part of lib; final f = (int i) => i.toDouble();');
1640 checkLibrary('''
1641 library lib;
1642 part "a.dart";
1643 ''');
1644 }
1645
1638 test_const_invalid_field_const() { 1646 test_const_invalid_field_const() {
1639 variablesWithNotConstInitializers.add('f'); 1647 variablesWithNotConstInitializers.add('f');
1640 checkLibrary( 1648 checkLibrary(
1641 r''' 1649 r'''
1642 class C { 1650 class C {
1643 static const f = 1 + foo(); 1651 static const f = 1 + foo();
1644 } 1652 }
1645 int foo() => 42; 1653 int foo() => 42;
1646 ''', 1654 ''',
1647 allowErrors: true); 1655 allowErrors: true);
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 fail('Unexpectedly tried to get unlinked summary for $uri'); 4703 fail('Unexpectedly tried to get unlinked summary for $uri');
4696 } 4704 }
4697 return serializedUnit; 4705 return serializedUnit;
4698 } 4706 }
4699 4707
4700 @override 4708 @override
4701 bool hasLibrarySummary(String uri) { 4709 bool hasLibrarySummary(String uri) {
4702 return true; 4710 return true;
4703 } 4711 }
4704 } 4712 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698