Skip to content

Error bridged to NSError's localizedDescription doesn't use the CustomStringConvertible #58724

@weissi

Description

@weissi

This is very similar to #50193

import Foundation
struct MyError: Error, CustomStringConvertible { let description = "this is the right description" }
print((MyError() as NSError).localizedDescription)

leads to

$ pbpaste | swift -
The operation couldn’t be completed. (main.MyError error 1.)

so whatever you do, it'll show (TheErrorType error 1.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions