Enter the following code into a playground and observe the runtime exception:
func process(anArray : [Any]) {
}
let a = [1,2,[3],[4,[5,6]],[[7]], 8]
process(a)
the type inferred for 'a' is [NSObject] which results in: "fatal error: array cannot be bridged from Objective-C"
Steps to Reproduce:
Xcode 7.3
Open a playground
Enter the code in the description
Reveal the "debug area"
Observe the runtime exception.
Expected Results:
The compiler should generate a compile type error for incompatible types i.e. '[NSObject]' cannot be passed to a function expecting '[Any]'
Actual Results:
Runtime exception - "fatal error: array cannot be bridged from Objective-C"
Description
Summary:
Enter the following code into a playground and observe the runtime exception:
func process(anArray : [Any]) {
}
let a = [1,2,[3],[4,[5,6]],[[7]], 8]
process(a)
the type inferred for 'a' is [NSObject] which results in: "fatal error: array cannot be bridged from Objective-C"
Steps to Reproduce:
Expected Results: The compiler should generate a compile type error for incompatible types i.e. '[NSObject]' cannot be passed to a function expecting '[Any]'
Actual Results: Runtime exception - "fatal error: array cannot be bridged from Objective-C"
Version: Xcode 7.3 (7D175), OS X 10.11.4 (15E65)
Product Version: Xcode 7.3 (7D175) Created: 2016-04-19T10:20:58.248840 Originated: 2016-04-19T00:00:00 Open Radar Link: http://www.openradar.me/25799364