<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 16, 2017, at 9:20 AM, Sam Ding via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:</div><div class=""><div class=""><p class=""><font size="2" class="">I test the case "tuple_arguments.swift" for v4.0 and found it is failed when the swift compiler is built in "-d" debug mode, but it is passed </font><br class=""><font size="2" class="">when built in release mode.</font><br class=""><font size="2" class="">Here is a simple test case:</font></p><ul class=""><font size="2" color="#001FE2" class=""> // SR-4738</font><br class=""><br class=""><font size="2" color="#001FE2" class="">let sr4738 = (1, (2, 3))</font><br class=""><font size="2" color="#001FE2" class="">[sr4738].map { (x, (y, z)) -> Int in x + y + z } // expected-error {{use of undeclared type 'y'}}</font><br class=""><font size="2" color="#001FE2" class="">// expected-error@-1 {{closure tuple parameter does not support destructuring}} {{20-26=arg1}} {{38-38=let (y, z) = arg1</font><br class=""><font size="2" color="#001FE2" class="">; }}</font></ul><br class=""><font size="2" class="">Save it to a file (for example, tt.swift), then run following commands:</font><ul class=""><br class=""><font size="2" class=""> ` swift -frontend -target x86_64-unknown-linux-gnu -module-cache-path /tmp/ -swift-version 3 -typecheck -verify -disable-objc-attr-requires-foundation-module tt.swift -swift-version 4 `</font></ul><br class=""><font size="2" class="">If "swift" compiler is built with debug mode ("-d"), then got following output:</font><br class="">
<ul class=""><ul class=""><font size="2" color="#E01F25" class="">tt.swift:5:96: error: </font><b class=""><font size="2" color="#E01F25" class="">expected fix-it not seen</font></b><font size="2" color="#E01F25" class="">; actual fix-its: {{20-26=arg1}} {{38-38=let = arg1; }}</font><br class=""><font size="2" color="#E01F25" class="">.....</font><br class=""><font size="2" color="#E01F25" class=""> Stack dump:</font><br class=""><font size="2" color="#E01F25" class="">0. Program arguments: swift -frontend -target x86_64-unknown-linux-gnu -module-cache-path /tmp/ -swift-version 3 -typecheck -verify -disable-objc-attr-requires-foundation-module tt.swift -swift-version 4</font><br class=""><font size="2" color="#E01F25" class="">Aborted (core dumped)</font></ul></ul><br class=""><font size="2" class="">The testing "</font><font size="2" color="#004080" class="">lib/Frontend/DiagnosticVerifier.cpp:: checkForFixIt</font><font size="2" class="">" gives that </font><br class=""><font size="2" class="">the "ActualFixIt" is "let " and "Expected" is "let (y, z) = arg1", and then causes "core dumped" in an assert.</font><br class=""><font size="2" class="">However the both "ActualFixIt" and "Expected" match when the "swift" is built in release mode.</font><br class=""><font size="2" class="">Note that the all "fixed-it"s are stored in a list, originally is added by "DiagnosticVerifier::addDiagnostic"</font><br class=""><br class=""><font size="2" class="">Can anyone let me know how the compiler build options affect the test results.</font><br class=""><font size="2" class="">I tested the same case on s390x and found the similar errors.</font></div></div></blockquote><br class=""></div><div>That error looks like the swift compiler frontend process is crashing during the test. The build configuration of the compiler can definitely affect crashes of the compiler itself. Have you filed a bug report?</div><div><br class=""></div><div><br class=""></div><div>-- </div><div>Greg Parker <a href="mailto:gparker@apple.com" class="">gparker@apple.com</a> Runtime Wrangler</div><div><br class=""></div><div><br class=""></div></body></html>