Skip to content

Commit

Permalink
[Sema] Still use the current minimum deployment target as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
xymus committed Oct 9, 2020
1 parent 39ee591 commit c79d5cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Sema/TypeCheckAvailability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,14 @@ TypeChecker::overApproximateAvailabilityAtLocation(SourceLoc loc,
}
}

// If we still don't have an introduction version, use the current deployment
// target. This covers cases where an inlinable function and its parent
// contexts don't have explicit availability attributes.
if (!OverApproximateContext.getOSVersion().hasLowerEndpoint()) {
auto currentOS = AvailabilityContext::forDeploymentTarget(Context);
OverApproximateContext.constrainWith(currentOS);
}

return OverApproximateContext;
}

Expand Down

0 comments on commit c79d5cf

Please sign in to comment.