Skip to content

Commit

Permalink
Reference IssueReporting symbols instead of XCTestDynamicOverlay (#3256)
Browse files Browse the repository at this point in the history
While we should get both dependencies picked up from
swift-dependencies' exports, we've heard reports from folks that they're
getting linker/symbol errors here. We should update these uses
regardless!
  • Loading branch information
stephencelis authored Jul 24, 2024
1 parent 37241ea commit 5b6fbc5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting",
"state" : {
"revision" : "926f43898706eaa127db79ac42138e1ad7e85a3f",
"version" : "1.2.0"
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting",
"state" : {
"revision" : "926f43898706eaa127db79ac42138e1ad7e85a3f",
"version" : "1.2.0"
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting",
"state" : {
"revision" : "926f43898706eaa127db79ac42138e1ad7e85a3f",
"version" : "1.2.0"
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.3"),
.package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "1.5.2"),
.package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: "1.2.2"),
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"601.0.0-prerelease"),
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ struct MainApp: App {

var body: some Scene {
WindowGroup {
if _XCTIsTesting {
if isTesting {
// NB: Don't run application in tests to avoid interference
// between the app and the test.
EmptyView()
Expand Down
35 changes: 3 additions & 32 deletions Sources/ComposableArchitecture/Reducer/Reducers/StackReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public struct StackState<Element> {
_read { yield self._dictionary[id] }
_modify { yield &self._dictionary[id] }
set {
switch (self.ids.contains(id), newValue, _XCTIsTesting) {
switch (self.ids.contains(id), newValue, isTesting) {
case (true, _, _), (false, .some, true):
self._dictionary[id] = newValue
case (false, .some, false):
if !_XCTIsTesting {
if !isTesting {
reportIssue(
"Can't assign element at missing ID.",
fileID: fileID.rawValue,
Expand All @@ -65,35 +65,6 @@ public struct StackState<Element> {
}
}

// subscript(
// id id: StackElementID,
// fileID fileID: HashableStaticString,
// filePath filePath: HashableStaticString,
// line line: UInt = #line,
// column column: UInt = #column
// ) -> Element? {
// _read { yield self._dictionary[id] }
// _modify { yield &self._dictionary[id] }
// set {
// switch (self.ids.contains(id), newValue, _XCTIsTesting) {
// case (true, _, _), (false, .some, true):
// self._dictionary[id] = newValue
// case (false, .some, false):
// if !_XCTIsTesting {
// reportIssue(
// "Can't assign element at missing ID.",
// fileID: fileID.rawValue,
// filePath: filePath.rawValue,
// line: line,
// column: column
// )
// }
// case (false, .none, _):
// break
// }
// }
// }

/// Accesses the value associated with the given id and case for reading and writing.
///
/// When using stack-based navigation (see <doc:StackBasedNavigation>) you will typically have a
Expand Down Expand Up @@ -755,7 +726,7 @@ extension StackElementID: CustomDumpStringConvertible {

extension StackElementID: ExpressibleByIntegerLiteral {
public init(integerLiteral value: Int) {
if !_XCTIsTesting {
if !isTesting {
fatalError(
"""
Specifying stack element IDs by integer literal is not allowed outside of tests.
Expand Down

0 comments on commit 5b6fbc5

Please sign in to comment.