<html><body><p><font size="2">Hi all,</font><br><br><font size="2">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><font size="2">when built in release mode.</font><br><font size="2">Here is a simple test case:</font><ul><font size="2" color="#001FE2"> // SR-4738</font><br><br><font size="2" color="#001FE2">let sr4738 = (1, (2, 3))</font><br><font size="2" color="#001FE2">[sr4738].map { (x, (y, z)) -> Int in x + y + z } // expected-error {{use of undeclared type 'y'}}</font><br><font size="2" color="#001FE2">// expected-error@-1 {{closure tuple parameter does not support destructuring}} {{20-26=arg1}} {{38-38=let (y, z) = arg1</font><br><font size="2" color="#001FE2">; }}</font></ul><br><font size="2">Save it to a file (for example, tt.swift), then run following commands:</font><ul><br><font size="2"> ` 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><font size="2">If "swift" compiler is built with debug mode ("-d"), then got following output:</font><br>
<ul><ul><font size="2" color="#E01F25">tt.swift:5:96: error: </font><b><font size="2" color="#E01F25">expected fix-it not seen</font></b><font size="2" color="#E01F25">; actual fix-its: {{20-26=arg1}} {{38-38=let = arg1; }}</font><br><font size="2" color="#E01F25">.....</font><br><font size="2" color="#E01F25"> Stack dump:</font><br><font size="2" color="#E01F25">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><font size="2" color="#E01F25">Aborted (core dumped)</font></ul></ul><br><font size="2">The testing "</font><font size="2" color="#004080">lib/Frontend/DiagnosticVerifier.cpp:: checkForFixIt</font><font size="2">" gives that </font><br><font size="2">the "ActualFixIt" is "let " and "Expected" is "let (y, z) = arg1", and then causes "core dumped" in an assert.</font><br><font size="2">However the both "ActualFixIt" and "Expected" match when the "swift" is built in release mode.</font><br><font size="2">Note that the all "fixed-it"s are stored in a list, originally is added by "DiagnosticVerifier::addDiagnostic"</font><br><br><font size="2">Can anyone let me know how the compiler build options affect the test results.</font><br><font size="2">I tested the same case on s390x and found the similar errors.</font><br><br><font size="2">Thanks,</font><br><br><font size="2">Sam Ding,</font><br><font size="2">Linux on z Systems Open Source Ecosystem</font><br><font size="2">IBM Toronto Lab, <br></font><font size="2" color="#0000FF">email: </font><font size="2">samding@ca.ibm.com</font><br><font size="2" color="#0000FF">phone:</font><font size="2"> (905)413-2947</font><BR>
</body></html>