Taking some tentative first steps with Swift and have quickly run into some difficulties/questions. I am attempting some real basic collection code (still learning Swift) and find that this does not compile:
let ints = [1, 2, 3]
let sum = ints.reduce(0, +)
This complains about unknown identifier op_Addition
Changing line #2 to the following compiles and runs as expected with a .net target:
let sum = ints.reduce(0) { $0 + $1 }
However, with a WebAssembly target although I get the same error for the (0, +)
incantation, the second form also does not compile, this time complaining No overloaded method reduce(::) with 2 parameters on type Array<Int64>
.
I had thought collections were “intrinsics” so am wondering what the state of Silver is w.r.t. the Swift language / runtime specification ? Are these bugs or expected results of design choices made to accommodate cross/multi-platform target considerations in the Elements context ?
Elements 10.0.0.2275 / Visual Studio 2015