All,

I have two function signatures for the following:

func linconv<T: FloatingPointType>(signal_A signal_A: [T], signal_B: [T]) -> 
[T]? {
    
    var arr = [T](count: 4, repeatedValue: 0.0)
    
    return nil
}

func linconv<T: IntegerType>(signal_A signal_A: [T], signal_B: [T]) -> [T]? {
    
    var arr = [T](count: 4, repeatedValue: 0)
    
    return nil
}

An error is called on the array initialization in the first case but not the 
second. The error message reads "Cannot invoke initializer for type '[T]' with 
an argument list of type '(count: Int, repeatedValue: Double)’”. Has anyone 
seen this? Is it a bug? It makes sense to me (so far anyway) that both should 
compile.

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to