Commit b901771
committed
Enable availability attributes for associated types
Allow `@available` on associated types, which can be introduced after
the protocol was introduced. These work precisely how on expects,
because all of the infrastructure for introducing associated types
later on has been available for a while, with two small restrictions:
1. If one uses the primary associated type syntax (e.g., `P<A, B>`),
then the primary associated types must also be available in the
current context.
2. Adding a new associated type to a resilient protocol requires that
associated type to have a default.1 parent baaa8f3 commit b901771
File tree
6 files changed
+105
-2
lines changed- include/swift/AST
- lib/Sema
- test/decl/protocol
6 files changed
+105
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2851 | 2851 | | |
2852 | 2852 | | |
2853 | 2853 | | |
2854 | | - | |
2855 | 2854 | | |
2856 | 2855 | | |
2857 | 2856 | | |
| |||
6841 | 6840 | | |
6842 | 6841 | | |
6843 | 6842 | | |
| 6843 | + | |
| 6844 | + | |
| 6845 | + | |
| 6846 | + | |
6844 | 6847 | | |
6845 | 6848 | | |
6846 | 6849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3880 | 3880 | | |
3881 | 3881 | | |
3882 | 3882 | | |
| 3883 | + | |
| 3884 | + | |
3883 | 3885 | | |
3884 | 3886 | | |
3885 | 3887 | | |
3886 | 3888 | | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
3887 | 3893 | | |
3888 | 3894 | | |
3889 | 3895 | | |
| |||
3895 | 3901 | | |
3896 | 3902 | | |
3897 | 3903 | | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
3898 | 3915 | | |
3899 | 3916 | | |
3900 | 3917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2866 | 2866 | | |
2867 | 2867 | | |
2868 | 2868 | | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
2869 | 2879 | | |
2870 | 2880 | | |
2871 | 2881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments