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

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_ast.dart

Issue 2814443005: Fix for summarization of generic function type aliases and support for resynthesizing. (Closed)
Patch Set: Created 3 years, 8 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 serialization.summarize_ast; 5 library serialization.summarize_ast;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/ast/visitor.dart'; 9 import 'package:analyzer/dart/ast/visitor.dart';
10 import 'package:analyzer/dart/element/type.dart' show DartType; 10 import 'package:analyzer/dart/element/type.dart' show DartType;
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 } 792 }
793 793
794 /** 794 /**
795 * Serialize a generic function type. 795 * Serialize a generic function type.
796 */ 796 */
797 EntityRefBuilder serializeGenericFunctionType(GenericFunctionType node) { 797 EntityRefBuilder serializeGenericFunctionType(GenericFunctionType node) {
798 _TypeParameterScope typeParameterScope = new _TypeParameterScope(); 798 _TypeParameterScope typeParameterScope = new _TypeParameterScope();
799 scopes.add(typeParameterScope); 799 scopes.add(typeParameterScope);
800 EntityRefBuilder b = new EntityRefBuilder(); 800 EntityRefBuilder b = new EntityRefBuilder();
801 b.entityKind = EntityRefKind.genericFunctionType; 801 b.entityKind = EntityRefKind.genericFunctionType;
802 b.typeParameters =
803 serializeTypeParameters(node.typeParameters, typeParameterScope);
802 b.syntheticReturnType = node.returnType == null 804 b.syntheticReturnType = node.returnType == null
803 ? serializeDynamic() 805 ? serializeDynamic()
804 : serializeTypeName(node.returnType); 806 : serializeTypeName(node.returnType);
805 b.typeParameters =
806 serializeTypeParameters(node.typeParameters, typeParameterScope);
807 b.syntheticParams = node.parameters.parameters 807 b.syntheticParams = node.parameters.parameters
808 .map((FormalParameter p) => p.accept(this) as UnlinkedParamBuilder) 808 .map((FormalParameter p) => p.accept(this) as UnlinkedParamBuilder)
809 .toList(); 809 .toList();
810 scopes.removeLast(); 810 scopes.removeLast();
811 return b; 811 return b;
812 } 812 }
813 813
814 /** 814 /**
815 * If the given [expression] is not `null`, serialize it as an 815 * If the given [expression] is not `null`, serialize it as an
816 * [UnlinkedExecutableBuilder], otherwise return `null`. 816 * [UnlinkedExecutableBuilder], otherwise return `null`.
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 /** 1486 /**
1487 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. 1487 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s.
1488 */ 1488 */
1489 class _TypeParameterScope extends _Scope { 1489 class _TypeParameterScope extends _Scope {
1490 /** 1490 /**
1491 * Get the number of [_ScopedTypeParameter]s defined in this 1491 * Get the number of [_ScopedTypeParameter]s defined in this
1492 * [_TypeParameterScope]. 1492 * [_TypeParameterScope].
1493 */ 1493 */
1494 int get length => _definedNames.length; 1494 int get length => _definedNames.length;
1495 } 1495 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/generated/non_error_resolver_driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698