I'm hitting a compiler crash when trying to build something equivalent to (reduced to) the following:
let layout = UICollectionViewFlowLayout()
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
let completion: ((Bool) -> Void) = { _ in
// nothing in the closure
}
collectionView.performBatchUpdates(nil, completion: completion)
With the following stack track:
0 swift 0x0000000109b96cf8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x0000000109b973a6 SignalHandler(int) + 598
2 libsystem_platform.dylib 0x00007fff682e5f5a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fb3502eaa00 _sigtramp + 3892333248
4 swift 0x0000000107355838 checkForViolationsInNoEscapeClosures(llvm::SmallDenseMap<(anonymous namespace)::AccessedStorage, (anonymous namespace)::AccessInfo, 4u, llvm::DenseMapInfo<(anonymous namespace)::AccessedStorage>, llvm::detail::DenseMapPair<(anonymous namespace)::AccessedStorage, (anonymous namespace)::AccessInfo> > const&, swift::FullApplySite, swift::AccessSummaryAnalysis*, llvm::SmallVectorImpl<(anonymous namespace)::ConflictingAccess>&) + 328
5 swift 0x000000010735436f (anonymous namespace)::DiagnoseStaticExclusivity::run() + 4287
6 swift 0x00000001072eb689 swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) + 1129
7 swift 0x00000001072ec375 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 1205
8 swift 0x00000001072eccfc swift::SILPassManager::execute() + 348
9 swift 0x00000001072f278c swift::runSILDiagnosticPasses(swift::SILModule&) + 332
10 swift 0x0000000106ada6cd performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 12093
11 swift 0x0000000106ad6802 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3266
12 swift 0x0000000106a94157 main + 2183
13 libdyld.dylib 0x00007fff68064115 start + 1
14 libdyld.dylib 0x00000000000001cd start + 2549727417
If I comment out the performBatchUpdates line then I get linker errors similar to @hartbit
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtC7Sample27ProfileMainViewController", referenced from:
objc-class-ref in SAAMoreMenuViewController.o
"_OBJC_CLASS_$__TtC7Sample25FSDetailsViewController", referenced from:
objc-class-ref in SAAResultsViewController.o
"_OBJC_CLASS_$__TtC7Sample18FirewallAuthToken", referenced from:
objc-class-ref in SAADataStore.o
"_OBJC_CLASS_$__TtC7Sample31DetailListUnifiedViewController", referenced from:
objc-class-ref in SAAAppDelegate-29FF8FF3F5D95CA3.o
"_OBJC_CLASS_$__TtC7Sample31NotificationParameters", referenced from:
objc-class-ref in SAAItem.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is in a mixed ObjC & Swift project with ~100kloc of each Swift and ObjC and builds properly with Version 9.3 beta 4 (9Q127n) toolchain.