From 1b5fc7fb80e4e6f4b6ebbeb2d3b72dcd943a7eb7 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Fri, 5 Dec 2025 17:29:02 -0800 Subject: [PATCH] DeCo. Comment out assert(nameOffset != null ...) --- lib/src/model/model_element.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/src/model/model_element.dart b/lib/src/model/model_element.dart index 571ab587df..a9a05622fa 100644 --- a/lib/src/model/model_element.dart +++ b/lib/src/model/model_element.dart @@ -588,8 +588,11 @@ abstract class ModelElement final lineInfo = unitElement.lineInfo; final nameOffset = element.firstFragment.nameOffset; - assert(nameOffset != null && nameOffset >= 0, - '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 + // no name offset. + // assert(nameOffset != null && nameOffset >= 0, + // 'Invalid location data, $nameOffset, for element: $fullyQualifiedName'); if (nameOffset != null && nameOffset >= 0) { return lineInfo.getLocation(nameOffset); }