File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -312,19 +312,23 @@ Optional<Version> Version::getEffectiveLanguageVersion() const {
312
312
return None;
313
313
}
314
314
315
- // FIXME: When we switch to Swift 4 by default, the "3 " case should return
316
- // a version newer than any released 3 .x compiler (probably "3.2") , and the
317
- // "4 " case should start returning getCurrentLanguageVersion. We should
315
+ // FIXME: When we switch to Swift 5 by default, the "4 " case should return
316
+ // a version newer than any released 4 .x compiler, and the
317
+ // "5 " case should start returning getCurrentLanguageVersion. We should
318
318
// also check for the presence of SWIFT_VERSION_PATCHLEVEL, and if that's
319
319
// set apply it to the "3" case, so that Swift 4.0.1 will automatically
320
320
// have a compatibility mode of 3.2.1.
321
321
switch (Components[0 ]) {
322
322
case 3 :
323
- static_assert (SWIFT_VERSION_MAJOR == 3 ,
323
+ #ifdef SWIFT_VERSION_PATCHLEVEL
324
+ return Version{3 , 2 , SWIFT_VERSION_PATCHLEVEL};
325
+ #else
326
+ return Version{3 , 2 };
327
+ #endif
328
+ case 4 :
329
+ static_assert (SWIFT_VERSION_MAJOR == 4 ,
324
330
" getCurrentLanguageVersion is no longer correct here" );
325
331
return Version::getCurrentLanguageVersion ();
326
- case 4 :
327
- return Version{4 , 0 };
328
332
default :
329
333
return None;
330
334
}
You can’t perform that action at this time.
0 commit comments