我正在我的新Mac上浏览新的Swift iBook,我正在本书的介绍/教程部分,它概述了该语言。在关于函数的部分的最后,它给出了一个带有一个名为“numbers.map”的闭包的例子。每当我尝试在我的源代码中输入“numbers.map”时,Xcode就会崩溃。弹出一个灰色框,表示:SourceKitService终止编辑器功能暂时受限。然后它给我一个崩溃报告,并要求我重新打开Xcode。此消息似乎告诉我崩溃发生在线程21:崩溃的线程:21 IDEPlaygroundExecutionSessionThread(pid = 406。这似乎是每次崩溃的同一个线程。这是线程的报告:
Thread 21 Crashed:: IDEPlaygroundExecutionSessionThread(pid=406)
0 com.apple.LLDB.framework 0x000000010e53fd21 swift::IterableDeclContext::loadAllMembers() const + 17
1 com.apple.LLDB.framework 0x000000010e537dac swift::NominalTypeDecl::getMembers(bool) const + 28
2 com.apple.LLDB.framework 0x000000010e794582 (anonymous namespace)::LowerType::visitAnyStructType(swift::CanType, swift::StructDecl*) + 194
3 com.apple.LLDB.framework 0x000000010e792040 swift::Lowering::TypeLowering const* swift::CanTypeVisitor<(anonymous namespace)::LowerType, swift::Lowering::TypeLowering const*>::visit<>(swift::CanType) + 128
4 com.apple.LLDB.framework 0x000000010e791e46 swift::Lowering::TypeConverter::getTypeLoweringForUncachedLoweredType(swift::Lowering::TypeConverter::TypeKey) + 118
5 com.apple.LLDB.framework 0x000000010e7918b6 swift::Lowering::TypeConverter::getTypeLowering(swift::Lowering::AbstractionPattern, swift::Type, unsigned int) + 2198
6 com.apple.LLDB.framework 0x000000010e7b2337 swift::Lowering::SILGenFunction::emitInitializationForVarDecl(swift::VarDecl*, bool, swift::Type) + 295
7 com.apple.LLDB.framework 0x000000010e7b2bef swift::ASTVisitor<(anonymous namespace)::InitializationForPattern, void, void, void, std::__1::unique_ptr<swift::Lowering::Initialization, std::__1::default_delete<swift::Lowering::Initialization> >, void, void>::visit(swift::Pattern*) + 415
8 com.apple.LLDB.framework 0x000000010e7b2963 swift::Lowering::SILGenFunction::visitPatternBindingDecl(swift::PatternBindingDecl*) + 51
9 com.apple.LLDB.framework 0x000000010e7ebbdc swift::Lowering::SILGenFunction::visitBraceStmt(swift::BraceStmt*) + 332
10 com.apple.LLDB.framework 0x000000010e7a361b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 395
11 com.apple.LLDB.framework 0x000000010e7a38cb swift::SILModule::constructSIL(swift::Module*, swift::SourceFile*, unsigned int) + 331
12 com.apple.LLDB.framework 0x000000010e7a39b0 swift::performSILGeneration(swift::SourceFile&, unsigned int) + 32
13 com.apple.LLDB.framework 0x000000010eb24925 lldb_private::SwiftExpressionParser::Parse(lldb_private::Stream&, unsigned int, unsigned int, unsigned int) + 9433
14 com.apple.LLDB.framework 0x000000010e912fe8 lldb_private::ClangUserExpression::Parse(lldb_private::Stream&, lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool, unsigned int) + 1022
15 com.apple.LLDB.framework 0x000000010e914738 lldb_private::ClangUserExpression::Evaluate(lldb_private::ExecutionContext&, lldb_private::EvaluateExpressionOptions const&, char const*, char const*, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::Error&, unsigned int) + 496
16 com.apple.LLDB.framework 0x000000010ea60d65 lldb_private::Target::EvaluateExpression(char const*, lldb_private::StackFrame*, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::EvaluateExpressionOptions const&) + 367
17 com.apple.LLDB.framework 0x000000010d23babc lldb::SBFrame::EvaluateExpression(char const*, lldb::SBExpressionOptions const&) + 598
18 com.apple.dt.IDELanguageSupportUI 0x0000000114cea802 -[IDEPlaygroundExecutionSession _executePlaygroundSource] + 603
19 com.apple.dt.IDELanguageSupportUI 0x0000000114ce9631 -[IDEPlaygroundExecutionSession handleInternalSessionEvent:] + 482
20 com.apple.dt.IDELanguageSupportUI 0x0000000114ce8837 -[IDEPlaygroundExecutionSession listenForEvents] + 535
21 com.apple.dt.IDELanguageSupportUI 0x0000000114ce8479 IDEPlaygroundExecutionSessionThread(void*) + 132
22 libsystem_pthread.dylib 0x00007fff8a342899 _pthread_body + 138
23 libsystem_pthread.dylib 0x00007fff8a34272a _pthread_start + 137
24 libsystem_pthread.dylib 0x00007fff8a346fc9 thread_start + 13
...而且底部也有一个摘要,如下所示:
Thread 21 crashed with X86 Thread State (64-bit):
rax: 0x00007fb939a83dd8 rbx: 0x0000f00000000079 rcx: 0x0000000000000000 rdx: 0x0000f00000000009
rdi: 0x0000f00000000079 rsi: 0x0000000000000001 rbp: 0x000000012648ab10 rsp: 0x000000012648aae0
r8: 0x00007fb9341658c8 r9: 0x00007fb939cd4880 r10: 0x0000000000000000 r11: 0x0000000000000001
r12: 0x000000012648ad58 r13: 0x00007fb9341658c8 r14: 0x0000f00000000079 r15: 0x0000000000000001
rip: 0x000000010e53fd21 rfl: 0x0000000000010297 cr2: 0x00007fb939ce8000
Logical CPU: 0
Error Code: 0x00000000
Trap Number: 13
这是一个可以修复的问题,或者可能只是一个问题Apple必须修补更新?感谢。