@@ -61,6 +61,11 @@ static enum sdk_test isAppAtLeastSpring2021() {
61
61
const dyld_build_version_t spring_2021_os_versions = {0xffffffff , 0x007e50301 };
62
62
return isAppAtLeast (spring_2021_os_versions);
63
63
}
64
+
65
+ static enum sdk_test isAppAtLeastFall2023 () {
66
+ const dyld_build_version_t fall_2023_os_versions = {0xffffffff , 0x007e70901 };
67
+ return isAppAtLeast (fall_2023_os_versions);
68
+ }
64
69
#endif
65
70
66
71
static _SwiftStdlibVersion binCompatVersionOverride = { 0 };
@@ -189,7 +194,11 @@ bool useLegacyOptionalNilInjectionInCasting() {
189
194
// by that protocol.
190
195
bool useLegacyObjCBoxingInCasting () {
191
196
#if BINARY_COMPATIBILITY_APPLE
192
- return false ; // For now, always use the new behavior on Apple OSes
197
+ switch (isAppAtLeastFall2023 ()) {
198
+ case oldOS: return true ; // Legacy behavior on old OS
199
+ case oldApp: return true ; // Legacy behavior for old apps
200
+ case newApp: return false ; // New behavior for new apps
201
+ }
193
202
#else
194
203
return false ; // Always use the new behavior on non-Apple OSes
195
204
#endif
@@ -209,7 +218,11 @@ bool useLegacyObjCBoxingInCasting() {
209
218
210
219
bool useLegacySwiftValueUnboxingInCasting () {
211
220
#if BINARY_COMPATIBILITY_APPLE
212
- return false ; // For now, always use the new behavior on Apple OSes
221
+ switch (isAppAtLeastFall2023 ()) {
222
+ case oldOS: return true ; // Legacy behavior on old OS
223
+ case oldApp: return true ; // Legacy behavior for old apps
224
+ case newApp: return false ; // New behavior for new apps
225
+ }
213
226
#else
214
227
return false ; // Always use the new behavior on non-Apple OSes
215
228
#endif
0 commit comments