Uploaded image for project: 'Swift'
  1. Swift
  2. SR-10562

Imported NS_ERROR_ENUM errors have weird "related decl" description

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:
    • Environment:

      Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
      Target: x86_64-apple-darwin18.5.0

      Description

      When printing an error created from an Obj-C NS_ERROR_ENUM declaration, the imported error has a bizarre synthesized description that looks like "related decl 'e' for <desc>" (where <desc> is the actual expected description).

      For example, with the following Obj-C header:

      extern NSErrorDomain const FooErrorDomain;
      typedef NS_ERROR_ENUM(FooErrorDomain, FooError) {
          FooErrorOne = 1,
          FooErrorTwo
      };
      

      Printing a FooError(.one) from Swift produces the description

      related decl 'e' for FooError(_nsError: Error Domain=FooErrorDomain Code=1 "(null)")

      And the debug description looks like

      __C_Synthesized.related decl 'e' for FooError(_nsError: Error Domain=FooErrorDomain Code=1 "(null)")

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            lily Lily Ballard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: