Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ else()
message(STATUS "_SwiftFoundationICU_SourceDIR not provided, checking out local copy of swift-foundation-icu")
FetchContent_Declare(SwiftFoundationICU
GIT_REPOSITORY https://github.com/apple/swift-foundation-icu.git
GIT_TAG main)
GIT_TAG release/6.2.1)
endif()

if (_SwiftCollections_SourceDIR)
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ var dependencies: [Package.Dependency] {
from: "1.1.0"),
.package(
url: "https://github.com/apple/swift-foundation-icu",
branch: "main"),
branch: "release/6.2.1"),
.package(
url: "https://github.com/swiftlang/swift-syntax",
branch: "main")
branch: "release/6.2.1")
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ extension Locale.Region {

/// An array of the sub-regions, matching the specified category of the region.
@available(FoundationPreview 6.2, *)
public func subRegions(ofCategoy category: Category) -> [Locale.Region] {
#if FOUNDATION_FRAMEWORK
// Renamed in 6.2.1
@abi(func subRegions(ofCategoy category: Category) -> [Locale.Region])
#endif
public func subRegions(ofCategory category: Category) -> [Locale.Region] {
var status = U_ZERO_ERROR
let icuRegion = uregion_getRegionFromCode(identifier, &status)
guard let icuRegion, status.isSuccess else {
Expand Down
2 changes: 1 addition & 1 deletion Sources/FoundationMacros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if(NOT SwiftSyntax_FOUND)
# If building at desk, check out and link against the SwiftSyntax repo's targets
FetchContent_Declare(SwiftSyntax
GIT_REPOSITORY https://github.com/swiftlang/swift-syntax.git
GIT_TAG main)
GIT_TAG release/6.2.1)
FetchContent_MakeAvailable(SwiftSyntax)
else()
message(STATUS "SwiftSyntax_DIR provided, using swift-syntax from ${SwiftSyntax_DIR}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ struct LocaleRegionTests {
}

@Test func subRegionOfCategory() async throws {
#expect(Locale.Region.unknown.subRegions(ofCategoy: .world) == [])
#expect(Locale.Region.unknown.subRegions(ofCategoy: .territory) == [])
#expect(Locale.Region.unknown.subRegions(ofCategory: .world) == [])
#expect(Locale.Region.unknown.subRegions(ofCategory: .territory) == [])

#expect(Set(Locale.Region.world.subRegions(ofCategoy: .continent)) == Set(Locale.Region.isoRegions(ofCategory: .continent)))
#expect(Set(Locale.Region.world.subRegions(ofCategory: .continent)) == Set(Locale.Region.isoRegions(ofCategory: .continent)))

#expect(Locale.Region.argentina.subRegions(ofCategoy: .continent) == [])
#expect(Locale.Region.argentina.subRegions(ofCategoy: .territory) == Locale.Region.argentina.subRegions)
#expect(Locale.Region.argentina.subRegions(ofCategory: .continent) == [])
#expect(Locale.Region.argentina.subRegions(ofCategory: .territory) == Locale.Region.argentina.subRegions)

#expect(Locale.Region("not a region").subRegions(ofCategoy: .territory) == [])
#expect(Locale.Region("not a region").subRegions(ofCategory: .territory) == [])
}
}