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

Xcode 11.2 beta 2 Regression: runtime crash with generic Foundation Encoder

    XMLWordPrintable

    Details

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

      Xcode Version 11.2 beta 2 (11B44)

      MacOS 10.14.6 (18G87)

      Description

      Hello,

      When an Encoder is generic and defined in a Swift Package library module, an Xcode app can't import this module and use this encoder without crashing right between the instantiation of the encoder and the call to the container(keyedBy: ) method, which is never called.

      A reproducible case is available at http://github.com/groue/GRDBIssue636, and attached to this issue.

      To reproduce:

      1. Open the Crash/Crash.xcodeproject project with Xcode 11.2 beta 2
      2. Run the app in an iOS simulator
      3. Expected: the app crashes with a "not implemented" fatal error
      4. Actual: the app crashes before the "not implemented" fatal error

      Experiments reveal that the bug does not reproduce when the encoder is not generic.

      Experiments reveal that the bug does not reproduce when the encoder is invoked from another swift package (run `swift build` and then `.build/debug/Crash` in order to see the expected "not implemented" fatal error, and not the unexpected crash.

      This issue was first reported in https://github.com/groue/GRDB.swift/issues/636

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            groue Gwendal Roué
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Dates

              Created:
              Updated: