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 c1bbae530e9b5549611a956d616053fd21b2a403..5a9cb479fa000cae4ad9a4bb814e3b2c85056eab 100644 |
--- a/pkg/analyzer/lib/src/summary/index_unit.dart |
+++ b/pkg/analyzer/lib/src/summary/index_unit.dart |
@@ -23,7 +23,9 @@ class IndexElementInfo { |
factory IndexElementInfo(Element element) { |
IndexSyntheticElementKind kind = IndexSyntheticElementKind.notSynthetic; |
- if (element.isSynthetic) { |
+ if (element is LibraryElement || element is CompilationUnitElement) { |
+ kind = IndexSyntheticElementKind.unit; |
+ } else if (element.isSynthetic) { |
if (element is ConstructorElement) { |
kind = IndexSyntheticElementKind.constructor; |
element = element.enclosingElement; |
@@ -60,8 +62,6 @@ class IndexElementInfo { |
throw new ArgumentError( |
'Unsupported synthetic element ${element.runtimeType}'); |
} |
- } else if (element is LibraryElement || element is CompilationUnitElement) { |
- kind = IndexSyntheticElementKind.unit; |
} |
return new IndexElementInfo._(element, kind); |
} |