Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions lib/src/model/canonicalization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,15 @@ final class _Canonicalization {
Element2? ancestor = element;
while (ancestor != null) {
if (ancestor is! ElementImpl2) {
if (ancestor is LibraryElementImpl) {
if (ancestor is LibraryElement2) {
components.insert(0, ancestor.identifier);
} else {
throw Exception('${ancestor.runtimeType} is not an ElementImpl2');
}
ancestor = ancestor.enclosingElement2;
} else {
components.insert(0, ancestor.identifier);
if (ancestor is LocalFunctionElementImpl) {
ancestor = (ancestor.wrappedElement.enclosingElement2
as ExecutableElementImpl)
.element;
} else {
ancestor = ancestor.enclosingElement2;
}
ancestor = ancestor.enclosingElement2;
}
}
var buffer = StringBuffer();
Expand Down