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

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

Issue 1658253002: Serialize constant instance creation of generic classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove the special case for unnamed constructors from _getElementReferenceId(). 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | 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) 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/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
9 import 'package:analyzer/src/generated/scanner.dart'; 9 import 'package:analyzer/src/generated/scanner.dart';
10 import 'package:analyzer/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
(...skipping 18 matching lines...) Expand all
29 _ConstExprSerializer(this.visitor); 29 _ConstExprSerializer(this.visitor);
30 30
31 @override 31 @override
32 EntityRefBuilder serializeConstructorName(ConstructorName constructor) { 32 EntityRefBuilder serializeConstructorName(ConstructorName constructor) {
33 EntityRefBuilder typeBuilder = serializeType(constructor.type); 33 EntityRefBuilder typeBuilder = serializeType(constructor.type);
34 if (constructor.name == null) { 34 if (constructor.name == null) {
35 return typeBuilder; 35 return typeBuilder;
36 } else { 36 } else {
37 String name = constructor.name.name; 37 String name = constructor.name.name;
38 int nameRef = visitor.serializeReference(typeBuilder.reference, name); 38 int nameRef = visitor.serializeReference(typeBuilder.reference, name);
39 return new EntityRefBuilder(reference: nameRef); 39 return new EntityRefBuilder(
40 reference: nameRef, typeArguments: typeBuilder.typeArguments);
40 } 41 }
41 } 42 }
42 43
43 EntityRefBuilder serializeIdentifier(Identifier identifier) { 44 EntityRefBuilder serializeIdentifier(Identifier identifier) {
44 EntityRefBuilder b = new EntityRefBuilder(); 45 EntityRefBuilder b = new EntityRefBuilder();
45 if (identifier is SimpleIdentifier) { 46 if (identifier is SimpleIdentifier) {
46 b.reference = visitor.serializeReference(null, identifier.name); 47 b.reference = visitor.serializeReference(null, identifier.name);
47 } else if (identifier is PrefixedIdentifier) { 48 } else if (identifier is PrefixedIdentifier) {
48 int prefix = visitor.serializeReference(null, identifier.prefix.name); 49 int prefix = visitor.serializeReference(null, identifier.prefix.name);
49 b.reference = 50 b.reference =
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 /** 876 /**
876 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. 877 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s.
877 */ 878 */
878 class _TypeParameterScope extends _Scope { 879 class _TypeParameterScope extends _Scope {
879 /** 880 /**
880 * Get the number of [_ScopedTypeParameter]s defined in this 881 * Get the number of [_ScopedTypeParameter]s defined in this
881 * [_TypeParameterScope]. 882 * [_TypeParameterScope].
882 */ 883 */
883 int get length => _definedNames.length; 884 int get length => _definedNames.length;
884 } 885 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698