Commit f631dc4
Fine. Add ElementImpl.firstFragmentLocation to avoid opaque requirements
Building context messages needs the element’s name location, but calling
`firstFragment` records an opaque API-use requirement. This patch adds a
specialized accessor that exposes only the needed fields so diagnostics
can be produced without introducing spurious dependencies.
Changes:
- Introduce `ElementImpl.firstFragmentLocation`, returning a lightweight
`FirstFragmentLocation` with `libraryFragment`, `name`, and
`nameOffset`, without recording an opaque requirement.
- Update `base_or_final_type_verifier.dart` to build the context message
from `firstFragmentLocation` instead of `firstFragment`.
This is intended to preserve diagnostic behavior while avoiding opaque
requirement tracking and the follow-on rebuilds it can cause.
Found with https://dart-review.googlesource.com/c/sdk/+/446480
Change-Id: I096091cd030824cbd8794f4063b963672056da29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446562
Reviewed-by: Paul Berry <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>1 parent 352addf commit f631dc4
File tree
3 files changed
+118
-7
lines changed- pkg/analyzer
- lib/src
- dart/element
- error
- test/src/dart/analysis
3 files changed
+118
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1699 | 1699 | | |
1700 | 1700 | | |
1701 | 1701 | | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
1702 | 1712 | | |
1703 | 1713 | | |
1704 | 1714 | | |
| |||
2877 | 2887 | | |
2878 | 2888 | | |
2879 | 2889 | | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
2880 | 2903 | | |
2881 | 2904 | | |
2882 | 2905 | | |
| |||
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
223 | | - | |
224 | | - | |
| 226 | + | |
| 227 | + | |
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
229 | | - | |
| 232 | + | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27019 | 27019 | | |
27020 | 27020 | | |
27021 | 27021 | | |
| 27022 | + | |
| 27023 | + | |
| 27024 | + | |
| 27025 | + | |
| 27026 | + | |
| 27027 | + | |
| 27028 | + | |
| 27029 | + | |
| 27030 | + | |
| 27031 | + | |
| 27032 | + | |
| 27033 | + | |
| 27034 | + | |
| 27035 | + | |
| 27036 | + | |
| 27037 | + | |
| 27038 | + | |
| 27039 | + | |
| 27040 | + | |
| 27041 | + | |
| 27042 | + | |
| 27043 | + | |
| 27044 | + | |
| 27045 | + | |
| 27046 | + | |
| 27047 | + | |
| 27048 | + | |
| 27049 | + | |
| 27050 | + | |
| 27051 | + | |
| 27052 | + | |
| 27053 | + | |
| 27054 | + | |
| 27055 | + | |
| 27056 | + | |
| 27057 | + | |
| 27058 | + | |
| 27059 | + | |
| 27060 | + | |
| 27061 | + | |
| 27062 | + | |
| 27063 | + | |
| 27064 | + | |
| 27065 | + | |
| 27066 | + | |
| 27067 | + | |
| 27068 | + | |
| 27069 | + | |
| 27070 | + | |
| 27071 | + | |
| 27072 | + | |
| 27073 | + | |
| 27074 | + | |
| 27075 | + | |
| 27076 | + | |
| 27077 | + | |
| 27078 | + | |
| 27079 | + | |
| 27080 | + | |
| 27081 | + | |
| 27082 | + | |
| 27083 | + | |
| 27084 | + | |
| 27085 | + | |
| 27086 | + | |
| 27087 | + | |
| 27088 | + | |
| 27089 | + | |
| 27090 | + | |
| 27091 | + | |
| 27092 | + | |
| 27093 | + | |
| 27094 | + | |
| 27095 | + | |
| 27096 | + | |
| 27097 | + | |
| 27098 | + | |
| 27099 | + | |
| 27100 | + | |
| 27101 | + | |
| 27102 | + | |
| 27103 | + | |
| 27104 | + | |
| 27105 | + | |
| 27106 | + | |
27022 | 27107 | | |
27023 | 27108 | | |
27024 | 27109 | | |
| |||
0 commit comments