Commit ad8b0f3
authored
[Sema] Allow @_section/@_used in concrete generic context (#75222)
Allow `@_section` and `@_used` to be used in fully constrained extensions.
This aligns with the existing behavior of static properties of generic types. The following is valid:
```swift
extension Array where Element == Int {
static let specificConstant = 41
}
```
However, adding `@_section` or `@_used` to the above property, will result in an error diagnostic.
This change updates the logic of `@_section`/`@_used` to allow their use when the generic context is fully concrete.1 parent bcfc0b6 commit ad8b0f3
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2385 | 2385 | | |
2386 | 2386 | | |
2387 | 2387 | | |
2388 | | - | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
2389 | 2392 | | |
2390 | 2393 | | |
2391 | 2394 | | |
| |||
2412 | 2415 | | |
2413 | 2416 | | |
2414 | 2417 | | |
2415 | | - | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
2416 | 2422 | | |
2417 | 2423 | | |
2418 | 2424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
0 commit comments