Let's say I have something similar to the standard Result
type:
enum TestResult<SuccessData, FailureData> {
case success(SuccessData)
case failure(FailureData)
}
That's fine in general, when SuccessData and FailureData are 'real' types - not Void. You could use it like this:
let result: TestResult<TestData, FailureReport> = .success(someData)
All good.
But, for my purposes sometimes one or both of those will be void (e.g. very simple test types which have no additional information to convey, just whether they succeeded or failed). In that case I apparently have to write:
let result: TestData<Void, Void> = .success(())
That's pretty ugly. Is there a way to omit the (())
?