Skip to content

Stop using ConstructorElementImpl #4040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
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
6 changes: 1 addition & 5 deletions lib/src/model/constructor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@

import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/source/line_info.dart';
// ignore: implementation_imports
import 'package:analyzer/src/dart/element/element.dart';
import 'package:dartdoc/src/element_type.dart';
import 'package:dartdoc/src/model/comment_referable.dart';
import 'package:dartdoc/src/model/kind.dart';
import 'package:dartdoc/src/model/model.dart';
import 'package:dartdoc/src/model_utils.dart';

class Constructor extends ModelElement with ContainerMember, TypeParameters {
@override

@override
final ConstructorElement2 element;

Expand All @@ -30,7 +26,7 @@ class Constructor extends ModelElement with ContainerMember, TypeParameters {
}
final lineInfo = unitElement.lineInfo;
var offset = element.firstFragment.nameOffset2 ??
(element.firstFragment as ConstructorElementImpl).typeNameOffset;
element.firstFragment.typeNameOffset;
if (offset != null && offset >= 0) {
return lineInfo.getLocation(offset);
}
Expand Down