| Index: pkg/analyzer/lib/src/summary/index_unit.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/index_unit.dart b/pkg/analyzer/lib/src/summary/index_unit.dart
|
| index 610fba4f8c3df46b9ccbb76340159f2ae2fee7c1..bc09ee345e6d6729afd049f7d1e51ac9e337d4c2 100644
|
| --- a/pkg/analyzer/lib/src/summary/index_unit.dart
|
| +++ b/pkg/analyzer/lib/src/summary/index_unit.dart
|
| @@ -204,6 +204,7 @@ class PackageIndexAssembler {
|
| * This method is static, so it cannot add any information to the index.
|
| */
|
| static ElementInfo newElementInfo(int unitId, Element element) {
|
| + int offset = null;
|
| IndexSyntheticElementKind kind = IndexSyntheticElementKind.notSynthetic;
|
| if (element.isSynthetic) {
|
| if (element is ConstructorElement) {
|
| @@ -242,11 +243,11 @@ class PackageIndexAssembler {
|
| throw new ArgumentError(
|
| 'Unsupported synthetic element ${element.runtimeType}');
|
| }
|
| - }
|
| - int offset = element.nameOffset;
|
| - if (element is LibraryElement || element is CompilationUnitElement) {
|
| + } else if (element is LibraryElement || element is CompilationUnitElement) {
|
| + kind = IndexSyntheticElementKind.unit;
|
| offset = 0;
|
| }
|
| + offset ??= element.nameOffset;
|
| return new ElementInfo(unitId, offset, kind);
|
| }
|
| }
|
|
|