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

Unified Diff: pkg/analyzer/lib/src/summary/index_unit.dart

Issue 1751453002: Add ElementInfo.id check fr null to debug flakiness on bots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c2c298e513ce0a40ce20dca4b8a390eb420ef460..ed3097dcdac801bf0b0f997e3cc0f8bfa958c33b 100644
--- a/pkg/analyzer/lib/src/summary/index_unit.dart
+++ b/pkg/analyzer/lib/src/summary/index_unit.dart
@@ -102,7 +102,7 @@ class PackageIndexAssembler {
offset = 0;
}
IndexSyntheticElementKind kind = getIndexElementKind(element);
- return new _ElementInfo(unitId, offset, kind);
+ return new _ElementInfo(element, unitId, offset, kind);
});
}
@@ -193,6 +193,11 @@ class _DefinedNameInfo {
*/
class _ElementInfo {
/**
+ * TODO(scheglov) remove after fixing build flakiness on bots
+ */
+ final Element element;
+
+ /**
* The identifier of the [CompilationUnitElement] containing this element.
*/
final int unitId;
@@ -213,7 +218,7 @@ class _ElementInfo {
*/
int id;
- _ElementInfo(this.unitId, this.offset, this.kind);
+ _ElementInfo(this.element, this.unitId, this.offset, this.kind);
}
/**
@@ -587,6 +592,10 @@ class _UnitIndexAssembler {
*/
UnitIndexBuilder assemble() {
relations.sort((a, b) {
+ if (a.elementInfo.id == null) {
+ throw new StateError('No id for ${a.elementInfo.element}, '
+ 'location= ${a.elementInfo.element?.location}');
+ }
return a.elementInfo.id - b.elementInfo.id;
});
definedNames.sort((a, b) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698