From c24d72d8ad0843b7cc1d638ee64a1b984d09fe0a Mon Sep 17 00:00:00 2001 From: Aleksey Berezka Date: Mon, 4 May 2026 22:18:09 +0500 Subject: [PATCH] Enable warnings as errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Package.swift | 14 +++++++++++--- Tests/DBThreadSafeTests/ThreadSafeTests.swift | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index a04895c..c32068b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 6.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -15,9 +15,17 @@ let package = Package( // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( - name: "DBThreadSafe"), + name: "DBThreadSafe", + swiftSettings: [ + .treatAllWarnings(as: .error) + ] + ), .testTarget( name: "DBThreadSafeTests", - dependencies: ["DBThreadSafe"]), + dependencies: ["DBThreadSafe"], + swiftSettings: [ + .treatAllWarnings(as: .error) + ] + ), ] ) diff --git a/Tests/DBThreadSafeTests/ThreadSafeTests.swift b/Tests/DBThreadSafeTests/ThreadSafeTests.swift index 61fa5c4..2a45af1 100644 --- a/Tests/DBThreadSafeTests/ThreadSafeTests.swift +++ b/Tests/DBThreadSafeTests/ThreadSafeTests.swift @@ -62,9 +62,10 @@ struct ThreadSafeTests { @Test("Concurrent reads via wrappedValue") func concurrentReads() { @ThreadSafe var value = 42 + let container = $value DispatchQueue.concurrentPerform(iterations: iterations) { _ in - _ = value + _ = container.read { $0 } } #expect(value == 42)