Skip to content

Commit 0b9e076

Browse files
authored
Underscore issue reporter type names (#112)
* Underscore issue reporter type names The big issue here is that `FatalErrorReporter` takes precedence in autocomplete over Swift's `fatalError` and is quite an annoyance when importing our library. These probably should have never been prominent when the preferred spelling is `.fatalError`, etc. This is a breaking bug fix change with fix-its. * wip
1 parent c94005c commit 0b9e076

File tree

7 files changed

+18
-27
lines changed

7 files changed

+18
-27
lines changed

Sources/IssueReporting/Documentation.docc/Extensions/IssueReporter.breakpoint.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

Sources/IssueReporting/Documentation.docc/Extensions/IssueReporter.fatalError.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

Sources/IssueReporting/Documentation.docc/Extensions/IssueReporter.runtimeWarning.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// NB: Deprecated after 1.2.2
2+
3+
#if canImport(Darwin)
4+
@available(*, unavailable, renamed: "_BreakpointReporter")
5+
public typealias BreakpointReporter = _BreakpointReporter
6+
#endif
7+
8+
@available(*, unavailable, renamed: "_FatalErrorReporter")
9+
public typealias FatalErrorReporter = _FatalErrorReporter
10+
11+
@available(*, unavailable, renamed: "_RuntimeWarningReporter")
12+
public typealias RuntimeWarningReporter = _RuntimeWarningReporter

Sources/IssueReporting/IssueReporters/BreakpointReporter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#if canImport(Darwin)
22
import Darwin
33

4-
extension IssueReporter where Self == BreakpointReporter {
4+
extension IssueReporter where Self == _BreakpointReporter {
55
/// An issue reporter that pauses program execution when a debugger is attached.
66
///
77
/// Logs a warning to the console and raises `SIGTRAP` when an issue is received.
@@ -12,7 +12,7 @@
1212
/// attached.
1313
///
1414
/// Use ``IssueReporter/breakpoint`` to create one of these values.
15-
public struct BreakpointReporter: IssueReporter {
15+
public struct _BreakpointReporter: IssueReporter {
1616
public func reportIssue(
1717
_ message: @autoclosure () -> String?,
1818
fileID: StaticString,

Sources/IssueReporting/IssueReporters/FatalErrorReporter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extension IssueReporter where Self == FatalErrorReporter {
1+
extension IssueReporter where Self == _FatalErrorReporter {
22
/// An issue reporter that terminates program execution.
33
///
44
/// Calls Swift's `fatalError` function when an issue is received.
@@ -8,7 +8,7 @@ extension IssueReporter where Self == FatalErrorReporter {
88
/// A type representing an issue reporter that terminates program execution.
99
///
1010
/// Use ``IssueReporter/fatalError`` to create one of these values.
11-
public struct FatalErrorReporter: IssueReporter {
11+
public struct _FatalErrorReporter: IssueReporter {
1212
public func reportIssue(
1313
_ message: @autoclosure () -> String?,
1414
fileID: StaticString,

Sources/IssueReporting/IssueReporters/RuntimeWarningReporter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Foundation
44
import os
55
#endif
66

7-
extension IssueReporter where Self == RuntimeWarningReporter {
7+
extension IssueReporter where Self == _RuntimeWarningReporter {
88
/// An issue reporter that emits "purple" runtime warnings to Xcode and logs fault-level messages
99
/// to the console.
1010
///
@@ -22,7 +22,7 @@ extension IssueReporter where Self == RuntimeWarningReporter {
2222
/// fault-level messages to the console.
2323
///
2424
/// Use ``IssueReporter/runtimeWarning`` to create one of these values.
25-
public struct RuntimeWarningReporter: IssueReporter {
25+
public struct _RuntimeWarningReporter: IssueReporter {
2626
#if canImport(os)
2727
@UncheckedSendable
2828
#if canImport(Darwin)

0 commit comments

Comments
 (0)