Skip to content

[SR-7652] Error bridged to NSError's description doesn't use my CustomStringConvertible instance's description #50193

@weissi

Description

@weissi
Previous ID SR-7652
Radar None
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Runtime
Assignee @theblixguy
Priority Medium

md5: 839f0bcd698aa191bfb33d06fa2cd5ce

Issue Description:

from a very recent Swift 4.2 snapshot on Darwin:

  1> import Foundation
  2> struct MyError: Error, CustomStringConvertible { let description = "this is the right description" }
  3> print((MyError() as NSError).description)
Error Domain=__lldb_expr_3.MyError Code=1 "(null)"

I think this definitely should print the description of MyError instead of the not so useful default NSError description

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.runtimeThe Swift Runtimestandard libraryArea: Standard library umbrella

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions