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

Global variables with didSet cause compiler crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      swift-DEVELOPMENT-SNAPSHOT-2018-12-07 / Mac / Xcode 10.1

      Description

      When using global variable with observer, it causes the recent trunk development swift toolchains to crash. Minimal test case is:

      enum Test {
        case a
      }

      var test: Test = .a {
        didSet {
          // stuff
          }
      }

      There are similar problems with structs and classes as well.

        Attachments

          Activity

            People

            • Assignee:
              slavapestov Slava Pestov
              Reporter:
              mox Mox Soini
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: