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

Infinite loop iterating through Array of IUOs

    XMLWordPrintable

    Details

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

      Any SWIFT system. This bug has been outstanding for Months.
      MacPro / Xcode just retested and the CPU goes pretty crazy

      Description

      //Copy the following into a Playground and watch your CPU hit 100% 
      
      class INK
      {
          var test = 1
      }
      
      var array = [INK!](repeating: nil, count: 1)
      
      for idx in 0..<array.count
      {
          array[idx] = INK()
      }
      
      var idx2 = 0
      for ink_item in array
      {
          idx2 += 1
          print("idx2=\(idx2)")
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              antony.newman ANTONY NEWMAN
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: