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

EXC_BREAKPOINT when creating a collection of specific type hierarchy.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Compiler
    • Labels:

      Description

      This originated from a discussion on the forums: https://forums.swift.org/t/exc-breakpoint-when-creating-array-with-specific-types/24060

      Given WrappingStruct which contains two properties, an SingleValueEnum and a Date. This causes an EXC_BREAKPOINT crash when run in the debugger.

      This crash seems to be closely tied to the types used and the exact structure created. It can be resolved via any of the below
      a.) Adding a second case to the enum
      b.) Changing the associated value from TimeZone to String
      c.) Adding a third property to the struct
      d.) Removing the enum property from the struct

      Quinn helped me to boil my example down in the forum post to an even smaller test case.
       
      ```
      import Foundation

      enum SingleValueEnum

      { case timezone(TimeZone) }

      struct WrappingStruct_Fails

      { let enumValue: SingleValueEnum let date: Date }

      func main()

      { let fails = [WrappingStruct_Fails]() print("fails: \(fails)") }

      main()

      ```

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aschwaighofer Arnold Schwaighofer
              Reporter:
              kcfancher Keli Fancher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: