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

SIL verification failed on reduce for CollectionType

    XMLWordPrintable

    Details

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

      Apple Swift version 3.0-dev (LLVM f95d47afa7, Clang f66c5bb67b, Swift b745691a38)
      January 25, 2016 Snapshot

      Description

      This code works on Swift 2.1. On 3.0-dev the compiler crashes. The log says: "SIL verification failed: entry point has wrong number of arguments: entry->bbarg_size() == ti->getParameters().size()"

      public protocol GLmathType : MutableCollectionType {
          typealias Element
      }
      
      // This is ok
      public func any<bvec:GLmathType>(x:bvec) -> Bool {
              return x.reduce(false) { $0 || $1 as! Bool }
      }
      
      // SIL verification failed: entry point has wrong number of arguments
      public func any<bvec:GLmathType where
          bvec.Generator.Element:BooleanType,
          bvec.Element == Bool
          >(x:bvec) -> bvec.Element {
              return x.reduce(false) { $0 || $1 }
      }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            dturnbull David Turnbull
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: