Skip to content

Commit 1b5fc7f

Browse files
committed
DeCo. Comment out assert(nameOffset != null ...)
1 parent 96f82ae commit 1b5fc7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/src/model/model_element.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,11 @@ abstract class ModelElement
588588
final lineInfo = unitElement.lineInfo;
589589

590590
final nameOffset = element.firstFragment.nameOffset;
591-
assert(nameOffset != null && nameOffset >= 0,
592-
'Invalid location data, $nameOffset, for element: $fullyQualifiedName');
591+
// TODO(scheglov): For extension types, or with primary constructors
592+
// and declaring formal parameters, the field has no declaration, so
593+
// no name offset.
594+
// assert(nameOffset != null && nameOffset >= 0,
595+
// 'Invalid location data, $nameOffset, for element: $fullyQualifiedName');
593596
if (nameOffset != null && nameOffset >= 0) {
594597
return lineInfo.getLocation(nameOffset);
595598
}

0 commit comments

Comments
 (0)