diff --git a/WorkbenchReplacement/MainView.swift b/WorkbenchReplacement/MainView.swift index 999cf26..ae52ac4 100644 --- a/WorkbenchReplacement/MainView.swift +++ b/WorkbenchReplacement/MainView.swift @@ -5635,7 +5635,7 @@ private struct WorkbenchTableSearchSheet: View { password: PasswordStore.read(profile.id), sql: sql) columns = result.rows.compactMap { $0.first } column = columns.first ?? "" - } catch { error = error.localizedDescription } + } catch let caughtError { error = caughtError.localizedDescription } } } } @@ -5740,7 +5740,7 @@ private struct WorkbenchCSVImportSheet: View { progress = 0 completed = false prepareMapping() - } catch { error = error.localizedDescription } + } catch let caughtError { error = caughtError.localizedDescription } } private func prepareMapping() { @@ -5764,7 +5764,7 @@ private struct WorkbenchCSVImportSheet: View { password: PasswordStore.read(profile.id), sql: sql) availableColumns = result.rows.compactMap(\.first) prepareMapping() - } catch { error = error.localizedDescription } + } catch let caughtError { error = caughtError.localizedDescription } } private func importRows() async { @@ -5801,8 +5801,8 @@ private struct WorkbenchCSVImportSheet: View { } completed = true model.loadTables(database: target.database) - } catch { - error = "Stopped after \(progress) rows: \(error.localizedDescription). Previously inserted rows may remain." + } catch let caughtError { + error = "Stopped after \(progress) rows: \(caughtError.localizedDescription). Previously inserted rows may remain." } busy = false } diff --git a/docs/PHASE59-1-COMPILER-FIX.md b/docs/PHASE59-1-COMPILER-FIX.md new file mode 100644 index 0000000..ba75d0a --- /dev/null +++ b/docs/PHASE59-1-COMPILER-FIX.md @@ -0,0 +1,5 @@ +# Phase 59.1 — Compiler diagnostic fix + +Fixed four error-handler expressions in the Phase 59 table search and CSV import views. Each view had a `@State` property named `error`, and the catch blocks also referenced Swift's implicit caught `error`, resulting in an ambiguous/shadowed reference while type-checking `WorkbenchTableSearchSheet.body` (reported at MainView.swift:5638). The caught exception is now explicitly bound as `caughtError`, and the UI's `error` state retains the human-readable message. + +This is a targeted compiler fix; no dashboard or editor UI redesign. Swift syntax parsing is verified on Linux; native macOS/Xcode compilation must be verified on a Mac.