Skip to content

Commit 659f50e

Browse files
committed
remove parameter pack method from linux because of compiler bug/crash
1 parent aa245a0 commit 659f50e

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

Sources/OpenWeatherKit/Public/WeatherService+Forecast.swift

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -415,34 +415,15 @@ extension WeatherService {
415415
/// `let (current, minute, hourly, daily, alerts) = try await service.weather(for: newYork, including: .current, .minute, .hourly, .daily, .alerts)`
416416
/// ```
417417
#if canImport(CoreLocation)
418-
@available(iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, visionOS 2.0, *)
418+
@available(macOS 11, iOS 13, watchOS 6, tvOS 13, visionOS 1, *)
419419
@preconcurrency final public func weather<each T>(
420420
for location: CLLocation,
421-
including dataSet: repeat WeatherQuery<each T>
421+
including dataSets: repeat WeatherQuery<each T>
422422
) async throws -> (repeat each T) {
423423
let (countryCode, timezone) = try await resolveCountryCodeAndTimezone(for: location)
424-
return try await weather(
425-
for: location,
426-
including: repeat each dataSet,
427-
countryCode: countryCode,
428-
timezone: timezone
429-
)
430-
}
431-
#endif
432424

433-
@available(iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, visionOS 2.0, *)
434-
@preconcurrency final public func weather<each T>(
435-
for location: CLLocation,
436-
including dataSets: repeat WeatherQuery<each T>,
437-
countryCode: String? = nil,
438-
timezone: TimeZone
439-
) async throws -> (repeat each T) {
440-
// Materialize the pack to a mutable variable to allow conditional mutation
441-
var _dataSets = (repeat each dataSets)
442-
// If a country code is provided, update each query with the country code for region-specific data
443-
if let countryCode {
444-
_dataSets = (repeat (each dataSets).update(with: countryCode))
445-
}
425+
// Update each dataSet with countryCode
426+
let _dataSets = (repeat (each dataSets).update(with: countryCode))
446427

447428
// The network client's fetchWeather method expects an array, so convert the pack into an array
448429
var queries: [any Query] = []
@@ -458,8 +439,9 @@ extension WeatherService {
458439
)
459440

460441
// Expand the pack to extract the typed results from the proxy for each query
461-
return (repeat try (each _dataSets).result(proxy))
442+
return (repeat try (each dataSets).result(proxy))
462443
}
444+
#endif
463445
}
464446

465447
extension WeatherService {

0 commit comments

Comments
 (0)