Commit 9eb648a
Elements. Compute class flags on ClassElementImpl
Move class-related flags off fragments and compute them directly on
`ClassElementImpl`. This reduces coupling to fragments and avoids
duplicated logic.
Changes:
- Compute `isConstructable` as `!isSealed && !isAbstract` instead of
delegating to `_firstFragment`.
- Compute `isExhaustive` as `isSealed`.
- Remove `hasGenerativeConstConstructor`, `isConstructable`, and
`isExhaustive` getters from `ClassFragmentImpl`.
- In constant verifier, resolve the enclosing class via
`container.declaredFragment!.element` and check `ClassElementImpl`
rather than fragment types.
Why:
- Centralizes flag computation on the element, making semantics clearer.
- Decreases fragment dependencies and maintenance surface.
Change-Id: I4b7153a4a55037e6dc12e18a32161a3472902eeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446008
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>1 parent 68ec39f commit 9eb648a
File tree
2 files changed
+4
-13
lines changed- pkg/analyzer/lib/src/dart
- constant
- element
2 files changed
+4
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1661 | 1661 | | |
1662 | 1662 | | |
1663 | 1663 | | |
1664 | | - | |
1665 | | - | |
| 1664 | + | |
| 1665 | + | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | 562 | | |
572 | 563 | | |
573 | 564 | | |
| |||
0 commit comments