Skip to content

Commit 43b8d45

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove FragmentImpl.source
Change-Id: I1949f0bb87fc18078c94100b5f9a658e3525e84a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441380 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent cf0a2b0 commit 43b8d45

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3688,12 +3688,6 @@ abstract class FragmentImpl implements Fragment {
36883688
return asElement2?.sinceSdkVersion;
36893689
}
36903690

3691-
/// Return the source associated with this target, or `null` if this target is
3692-
/// not associated with a source.
3693-
Source? get source {
3694-
return enclosingFragment?.source;
3695-
}
3696-
36973691
/// Whether to include the [nameOffset] in [identifier] to disambiguate
36983692
/// elements that might otherwise have the same identifier.
36993693
bool get _includeNameOffsetInIdentifier {
@@ -6127,7 +6121,6 @@ class LibraryExportImpl extends ElementDirectiveImpl implements LibraryExport {
61276121
class LibraryFragmentImpl extends _ExistingFragmentImpl
61286122
with DeferredResolutionReadingMixin
61296123
implements LibraryFragment {
6130-
/// The source that corresponds to this compilation unit.
61316124
@override
61326125
final Source source;
61336126

@@ -8218,9 +8211,6 @@ abstract class NonParameterVariableFragmentImpl extends VariableFragmentImpl {
82188211
set hasInitializer(bool hasInitializer) {
82198212
setModifier(Modifier.HAS_INITIALIZER, hasInitializer);
82208213
}
8221-
8222-
@override
8223-
Source get source => enclosingFragment.source!;
82248214
}
82258215

82268216
class PartIncludeImpl extends ElementDirectiveImpl implements PartInclude {
@@ -10371,9 +10361,6 @@ abstract class VariableFragmentImpl extends FragmentImpl
1037110361

1037210362
abstract class _ExistingFragmentImpl extends FragmentImpl {
1037310363
_ExistingFragmentImpl({required super.firstTokenOffset});
10374-
10375-
@override
10376-
Source get source => enclosingFragment!.source!;
1037710364
}
1037810365

1037910366
/// Instances of [List]s that are used as "not yet computed" values, they

pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ class MemberDuplicateDefinitionVerifier {
670670
if (accessor.isStatic) {
671671
continue;
672672
}
673-
if (accessor.source != _currentUnit.source) {
673+
if (accessor.libraryFragment.source != _currentUnit.source) {
674674
continue;
675675
}
676676
var baseName = accessor.displayName;
@@ -692,7 +692,7 @@ class MemberDuplicateDefinitionVerifier {
692692
if (method.isStatic) {
693693
continue;
694694
}
695-
if (method.source != _currentUnit.source) {
695+
if (method.libraryFragment.source != _currentUnit.source) {
696696
continue;
697697
}
698698
var baseName = method.displayName;
@@ -720,7 +720,7 @@ class MemberDuplicateDefinitionVerifier {
720720
}
721721

722722
for (var accessor in fragment.accessors) {
723-
if (accessor.source != _currentUnit.source) {
723+
if (accessor.libraryFragment.source != _currentUnit.source) {
724724
continue;
725725
}
726726
var baseName = accessor.displayName;
@@ -737,7 +737,7 @@ class MemberDuplicateDefinitionVerifier {
737737
}
738738

739739
for (var method in fragment.methods) {
740-
if (method.source != _currentUnit.source) {
740+
if (method.libraryFragment.source != _currentUnit.source) {
741741
continue;
742742
}
743743
var baseName = method.displayName;

pkg/analyzer/lib/src/generated/error_verifier.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2247,7 +2247,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
22472247

22482248
// method declared in the enclosing class vs. inherited getter/setter
22492249
for (var method in fragment.methods) {
2250-
if (method.source != _currentUnit.source) {
2250+
if (method.libraryFragment.source != _currentUnit.source) {
22512251
continue;
22522252
}
22532253

0 commit comments

Comments
 (0)