Fix build: annotate list-VM merge locals so .sorted infers its element
The generation-guard refactor moved the fetched.map{…}.sorted{…} chain into an
untyped `let merged`, dropping the type anchor the property assignment used to
provide. A multi-statement .map closure then leaves .sorted's $0 uninferred
(error: cannot infer type of closure parameter). Annotate merged in
OLTListViewModel and ONUListViewModel as [OLTStateDoc]/[ONUStateDoc].
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
203465913c
commit
7d8f1c7b2d
2 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ final class OLTListViewModel {
|
|||
do {
|
||||
let fetched = try await connection.olt.allStates()
|
||||
let names = (try? await connection.olt.nameMap()) ?? [:]
|
||||
let merged = fetched
|
||||
let merged: [OLTStateDoc] = fetched
|
||||
.map { olt in var olt = olt; olt.resolvedName = names[olt.id]; return olt }
|
||||
.sorted { $0.displayName.localizedCaseInsensitiveCompare($1.displayName) == .orderedAscending }
|
||||
guard gen == loadGeneration, !Task.isCancelled else { return }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue