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

Recursive generic class causing runtime error

    XMLWordPrintable

    Details

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

      Xcode 9 beta 6

      Description

      Declare the following classes :

       

      class Base<rootType : AnyObject> { }
      
      class Test : Base<Test> { }
      
      let test = Test()
      

       

      All compiles fine but, on instantiation of Test, produces runtime error : "EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              Joanna Carter Joanna Carter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: