, : 1) typealias , 2) , .
1.
. , Swift, .
typealias VoidToVoid = () -> ()
var c = [Int, Bool, VoidToVoid]() // works
var d = [Int, Bool, () -> ()]() // syntax error
2. segfaults .
func performSideEffects() {
println("Howdy")
}
c.append(1, true, performSideEffects)
c.count
c[0].2
0 swift 0x00000001020272b8 llvm::sys::PrintStackTrace(__sFILE*) + 40
1 swift 0x0000000102027794 SignalHandler(int) + 452
2 libsystem_platform.dylib 0x00007fff8131ff1a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fff5e2f0550 _sigtramp + 3707569744
4 swift 0x00000001019ea39d swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9901
5 swift 0x0000000101954f4f swift::irgen::IRGenModule::emitGlobalTopLevel() + 159
6 swift 0x00000001019d4c59 performIRGeneration(swift::IRGenOptions&, swift::Module*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 2121
7 swift 0x00000001019d5693 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 51
8 swift 0x0000000101911087 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 6647
9 swift 0x000000010190f4e6 main + 1814
10 libdyld.dylib 0x00007fff829f15c9 start + 1
11 libdyld.dylib 0x000000000000003b start + 2103503475