We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96f82ae commit 1b5fc7fCopy full SHA for 1b5fc7f
lib/src/model/model_element.dart
@@ -588,8 +588,11 @@ abstract class ModelElement
588
final lineInfo = unitElement.lineInfo;
589
590
final nameOffset = element.firstFragment.nameOffset;
591
- assert(nameOffset != null && nameOffset >= 0,
592
- 'Invalid location data, $nameOffset, for element: $fullyQualifiedName');
+ // TODO(scheglov): For extension types, or with primary constructors
+ // 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');
596
if (nameOffset != null && nameOffset >= 0) {
597
return lineInfo.getLocation(nameOffset);
598
}
0 commit comments