File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -3222,7 +3222,7 @@ class SemanticAvailableAttr final {
32223222
32233223 // / Returns the effective range in which the declaration with this attribute
32243224 // / was introduced.
3225- AvailabilityRange getIntroducedRange (ASTContext &Ctx) const ;
3225+ AvailabilityRange getIntroducedRange (const ASTContext &Ctx) const ;
32263226
32273227 // / The version tuple written in source for the `deprecated:` component.
32283228 std::optional<llvm::VersionTuple> getDeprecated () const {
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class AvailabilityDomain final {
8888
8989 // / Returns true if this domain is considered active in the current
9090 // / compilation context.
91- bool isActive (ASTContext &ctx) const ;
91+ bool isActive (const ASTContext &ctx) const ;
9292
9393 // / Returns the string to use in diagnostics to identify the domain. May
9494 // / return an empty string.
Original file line number Diff line number Diff line change @@ -828,10 +828,13 @@ bool AvailabilityInference::isAvailableAsSPI(const Decl *D) {
828828}
829829
830830AvailabilityRange
831- SemanticAvailableAttr::getIntroducedRange (ASTContext &Ctx) const {
832- auto *attr = getParsedAttr ();
831+ SemanticAvailableAttr::getIntroducedRange (const ASTContext &Ctx) const {
833832 assert (domain.isActive (Ctx));
834833
834+ auto *attr = getParsedAttr ();
835+ if (!attr->Introduced .has_value ())
836+ return AvailabilityRange::alwaysAvailable ();
837+
835838 llvm::VersionTuple IntroducedVersion = attr->Introduced .value ();
836839 StringRef Platform;
837840 llvm::VersionTuple RemappedIntroducedVersion;
Original file line number Diff line number Diff line change 1616
1717using namespace swift ;
1818
19- bool AvailabilityDomain::isActive (ASTContext &ctx) const {
19+ bool AvailabilityDomain::isActive (const ASTContext &ctx) const {
2020 switch (kind) {
2121 case Kind::Universal:
2222 case Kind::SwiftLanguage:
You can’t perform that action at this time.
0 commit comments