BlueHuskyStudios / BlueHuskyStudios/DeadassSimpleMediaPlayer

`ToastError.errorDescription` may not satisfy `LocalizedError`

Open Beginner friendly
#44 1 comment 0 reactions 0 assignees View on GitHub
Automatically found bug good first issue
Dominant language
Swift
Stars
0
Forks
3
Avg merge
2d 22h
Merged PRs (30d)
9

Description

```swift
public struct ToastError: LocalizedError, Identifiable {
public var errorDescription: String // protocol requires `String?`
```

Swift matches property witnesses by exact type, so a non-optional `String` may not satisfy `var errorDescription: String? { get }` — in which case `LocalizedError`'s default (returning `nil`) becomes the witness, and `(toastError as Error).localizedDescription` would produce a generic message rather than yours.

The app always reads `.textForToast` directly, so this is latent rather than visible. **Worth a 30-second check** — if the protocol witness does resolve to the default, any future code treating a `ToastError` as a plain `Error` loses its message.

Contributor guide

Open the contributing guide

Research direction

Start by locating ToastError.errorDescription and inspect its conformance to LocalizedError. Verify whether casting a ToastError to Error and reading localizedDescription preserves the intended message rather than the default nil result; completion is confirmed when the behavior is covered or clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.