Skip to content

Commit a97508d

Browse files
authored
Remove a TODO in Accessor.characterLocation (#3740)
I looked into `nonSynthetic` and it doesn't buy us anything here. Instead, we can just rely on analyzer's `isSynthetic` to get the right location.
1 parent bf6080c commit a97508d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/src/model/accessor.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@ class Accessor extends ModelElement {
3232
[ExecutableMember? super.originalMember]);
3333

3434
@override
35-
CharacterLocation? get characterLocation {
36-
if (element.nameOffset < 0) {
37-
assert(element.isSynthetic, 'Invalid offset for non-synthetic element');
38-
// TODO(jcollins-g): switch to [element.nonSynthetic] after analyzer 1.8
39-
return enclosingCombo.characterLocation;
40-
}
41-
return super.characterLocation;
42-
}
35+
CharacterLocation? get characterLocation => element.isSynthetic
36+
? enclosingCombo.characterLocation
37+
: super.characterLocation;
4338

4439
@override
4540
ExecutableMember? get originalMember =>

0 commit comments

Comments
 (0)