<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;">Hi,</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">I found a piece of code that could made the compiler crash, It’s can reproduce on Xcode 7.2(7C68) with Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81)&nbsp;Target: x86_64-apple-darwin15.2.0</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">the code is simply like:</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">protocol FooType {</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; func bar(b: Int)</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">extension FooType {</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; func bar(a: Int, b: Int) {</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; }</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">struct Foo: FooType {</div><div id="bloop_customfont" style="margin: 0px;">&nbsp;&nbsp;</div><div id="bloop_customfont" style="margin: 0px;">}</div></div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">Even the function’s default implementation signature in protocol extension is different with its definition in protocol, it can compiling successful with no error, but when compiling Foo, the compiler will crash, the stack is like:</div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">0 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0000000110dbcfbb llvm::sys::PrintStackTrace(__sFILE*) + 43</div><div id="bloop_customfont" style="margin: 0px;">1 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0000000110dbd6fb SignalHandler(int) + 379</div><div id="bloop_customfont" style="margin: 0px;">2 &nbsp;libsystem_platform.dylib 0x00007fff996feeaa _sigtramp + 26</div><div id="bloop_customfont" style="margin: 0px;">3 &nbsp;libsystem_platform.dylib 0x00007f9fa3aa12a8 _sigtramp + 171582488</div><div id="bloop_customfont" style="margin: 0px;">4 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f083707 swift::SILWitnessVisitor&lt;(anonymous namespace)::SILGenConformance&gt;::visitProtocolDecl(swift::ProtocolDecl*) + 999</div><div id="bloop_customfont" style="margin: 0px;">5 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f080ee5 swift::Lowering::SILGenModule::getWitnessTable(swift::ProtocolConformance*) + 277</div><div id="bloop_customfont" style="margin: 0px;">6 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f0d05b0 (anonymous namespace)::SILGenType::emitType() + 1264</div><div id="bloop_customfont" style="margin: 0px;">7 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f0d12d1 SILGenExtension::visitNominalTypeDecl(swift::NominalTypeDecl*) + 33</div><div id="bloop_customfont" style="margin: 0px;">8 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f0d0d4b SILGenExtension::emitExtension(swift::ExtensionDecl*) + 59</div><div id="bloop_customfont" style="margin: 0px;">9 &nbsp;swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f0d06f5 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 21</div><div id="bloop_customfont" style="margin: 0px;">10 swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f058bdb swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 779</div><div id="bloop_customfont" style="margin: 0px;">11 swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f059790 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&amp;, swift::FileUnit*, llvm::Optional&lt;unsigned int&gt;, bool, bool) + 928</div><div id="bloop_customfont" style="margin: 0px;">12 swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010f059b3d swift::performSILGeneration(swift::FileUnit&amp;, swift::SILOptions&amp;, llvm::Optional&lt;unsigned int&gt;, bool) + 109</div><div id="bloop_customfont" style="margin: 0px;">13 swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010eead992 performCompile(swift::CompilerInstance&amp;, swift::CompilerInvocation&amp;, llvm::ArrayRef&lt;char const*&gt;, int&amp;) + 11442</div><div id="bloop_customfont" style="margin: 0px;">14 swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010eeaaad3 frontend_main(llvm::ArrayRef&lt;char const*&gt;, char const*, void*) + 2691</div><div id="bloop_customfont" style="margin: 0px;">15 swift &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x000000010eea7154 main + 2324</div><div id="bloop_customfont" style="margin: 0px;">16 libdyld.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x00007fff8c66c5ad start + 1</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">Please check.</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">thank you!</div></div></div></div><div id="bloop_customfont" style="margin: 0px;"><br></div><div class="bloop_sign" id="bloop_sign_1450613832568138240"><div style="font-family: helvetica, arial;">--&nbsp;<br>Jasl<br>Sent with Airmail</div></div></div></body></html>