| Index: pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| index 5c50d2e14fdc8520923aa7c0617ee06944f47ebb..4d903184321a0f7cc6093266f916652a3f0f913e 100644
|
| --- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| +++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| @@ -678,7 +678,7 @@ class _CompilationUnitSerializer {
|
| * Serialize the given [type] into a [EntityRef]. If [slot] is provided,
|
| * it should be included in the [EntityRef]. If [linked] is true, any
|
| * references that are created will be populated into [linkedReferences] but
|
| - * [not [unlinkedReferences].
|
| + * not [unlinkedReferences].
|
| *
|
| * [context] is the element within which the [EntityRef] will be
|
| * interpreted; this is used to serialize type parameters.
|
| @@ -830,9 +830,6 @@ class _CompilationUnitSerializer {
|
|
|
| int _getElementReferenceId(Element element, {bool linked: false}) {
|
| return referenceMap.putIfAbsent(element, () {
|
| - if (element is ConstructorElement && element.displayName.isEmpty) {
|
| - return _getElementReferenceId(element.enclosingElement, linked: linked);
|
| - }
|
| LibraryElement dependentLibrary = element?.library;
|
| int unit;
|
| if (dependentLibrary == null) {
|
| @@ -911,10 +908,23 @@ class _ConstExprSerializer extends AbstractConstExprSerializer {
|
|
|
| @override
|
| EntityRefBuilder serializeConstructorName(ConstructorName constructor) {
|
| - ConstructorElement element = constructor.staticElement;
|
| - assert(element != null);
|
| - int referenceId = serializer._getElementReferenceId(element);
|
| - return new EntityRefBuilder(reference: referenceId);
|
| + DartType type = constructor.type.type;
|
| + EntityRefBuilder typeRef = serializer.serializeTypeRef(type, null);
|
| + if (constructor.name == null) {
|
| + return typeRef;
|
| + } else {
|
| + int typeId = typeRef.reference;
|
| + LinkedReference typeLinkedRef = serializer.linkedReferences[typeId];
|
| + serializer.unlinkedReferences.add(new UnlinkedReferenceBuilder(
|
| + name: constructor.name.name, prefixReference: typeId));
|
| + int refId = serializer.linkedReferences.length;
|
| + serializer.linkedReferences.add(new LinkedReferenceBuilder(
|
| + kind: ReferenceKind.constructor,
|
| + dependency: typeLinkedRef.dependency,
|
| + unit: typeLinkedRef.unit));
|
| + return new EntityRefBuilder(
|
| + reference: refId, typeArguments: typeRef.typeArguments);
|
| + }
|
| }
|
|
|
| EntityRefBuilder serializeIdentifier(Identifier identifier) {
|
|
|