Swift Compiler Crash: Abort trap 6

Originator:chriseidhof
Number:rdar://21405314 Date Originated:16-Jun-2015
Status:Open Resolved:
Product:Xcode Product Version:7b1
Classification: Reproducible:
 
Chris Eidhof16-Jun-2015 11:12 AM

The attached program crashes with the following assertion:

Assertion failed: ((!selfParam.isIndirectInOut() || (baseType.getSwiftRValueType()->isAnyClassReferenceType() && isa<ProtocolDecl>(accessor.getDecl()->getDeclContext()) && !cast<ProtocolDecl>(accessor.getDecl()->getDeclContext()) ->requiresClass())) && "passing unmaterialized r-value as inout argument"), function prepareAccessorBaseArg, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.38.1/src/swift/lib/SILGen/SILGenApply.cpp, line 3633.

Comments

import Foundation
import CoreImage

struct GaussianBlur {

    private var filter: CIFilter
    private var filterForMutating: CIFilter {
        mutating get {
            filter = filter.copy() as! CIFilter
            return filter
        }
    }    

    var inputImage: CIImage? {
        get { return filter.valueForKey(kCIInputImageKey) as? CIImage }
        set {
            filterForMutating.setValue(newValue, forKey: kCIInputImageKey)
        }
    }
}
By chriseidhof at June 16, 2015, 6:22 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!