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

Program with struct nested in generic struct crashes because of “cyclic metadata dependency”

    XMLWordPrintable

    Details

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

      Xcode
      Version 8.2.1 (8C1002)
      Toolchain: Swift 3.1 Snapshot 2017-01-22 (a)

      Description

      public struct Base<Element> {
        public struct Glue {
          enum Backing {
            case known(Element)
            case unknown(Int)
          }
          var backing: Backing
          
          static func unknown() -> Glue {
            return Glue(backing: .unknown(0))
          }
        }
      }
      
      let x: Base<Int>.Glue = .unknown() // CRASH: "GenericCache(0x1002df1c8): cyclic metadata dependency detected, aborting"
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jadengeller Jaden Geller
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: