<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On May 10, 2017, at 11:06 AM, Pushkar N Kulkarni &lt;<a href="mailto:pushkar.nk@in.ibm.com" class="">pushkar.nk@in.ibm.com</a>&gt; wrote:</div><div class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div class=""><div class="">The issue is seen with the 05-09 dev snapshot. However after updating the repos today, I no longer see it!&nbsp;</div><div class=""><br class=""></div><div class="">Looks like one of yesterday's commits (which did not go into 05-09) &nbsp;fixed it. I am closing the JIRA report. Thanks!</div></div></font></div></blockquote><div><br class=""></div>Okay, glad we managed to fix it; thanks.</div><div><br class=""></div><div>John.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><font class=""><font class=""><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div dir="ltr" style="font-style: normal;" class=""><br class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Pushkar N Kulkarni,</font></div>
<div dir="ltr" style="font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">IBM Runtimes</font></div><div dir="ltr" style="font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class=""><br class=""></font></div><div dir="ltr" class=""><font face="serif, Times New Roman, Times, serif" class=""><i class="">Simplicity is prerequisite for reliability - Edsger W. Dijkstra</i></font></div>
<div dir="ltr" style="font-style: normal; font-size: 10.5pt; font-family: Arial;" class=""><br class=""></div></div></div></div></font></font></font></div><br class=""><br class=""><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" class=""><font color="#990099" class=""><a href="mailto:-----swift-dev-bounces@swift.org" target="_blank" class="">-----swift-dev-bounces@swift.org</a> wrote: -----</font><div class="iNotesHistory" style="padding-left:5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;" class="">To: John McCall &lt;<a href="mailto:rjmccall@apple.com" target="_blank" class="">rjmccall@apple.com</a>&gt;<br class="">From: Pushkar N Kulkarni via swift-dev <swift-dev@swift.org class=""><br class="">Sent by: <a href="mailto:swift-dev-bounces@swift.org" target="_blank" class="">swift-dev-bounces@swift.org</a><br class="">Date: 05/10/2017 06:00PM<br class="">Cc: swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a>&gt;<br class="">Subject: Re: [swift-dev] Property modification not taking effect<br class=""><br class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class="">Thanks John. This is the JIRA bug report:&nbsp;<a href="https://bugs.swift.org/browse/SR-4852" target="_blank" class="">https://bugs.swift.org/browse/SR-4852</a></div><div style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><br class=""></div><div style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class="">I was able to write a small test case that shows the regression:</div><div style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><br class=""></div><div class=""><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">enum State {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; case ready(TState)</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; case inProgress(TState)</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class=""><br class=""></font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; var isPaused: Bool {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; switch self {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; case .ready: return false</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; case .inProgress: return false</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">}</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class=""><br class=""></font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">enum Drain {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; case foo(String)</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; case bar(Int, String)</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">}</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class=""><br class=""></font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">struct TState {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; let drain: Drain</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">}</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class=""><br class=""></font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">class Task {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; var state = State.ready(TState(drain: .foo("wow"))) {&nbsp;</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; willSet {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if newValue.isPaused { }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class=""><br class=""></font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; func resume() {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; if case .ready(let tState) = state {</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print("before =&gt; \(state)")</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; state = .inProgress(tState) //doesn't take effect</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print("after =&gt; \(state)")</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">&nbsp; &nbsp; }</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">} &nbsp; &nbsp;</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class=""><br class=""></font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">//main</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000cc" class="">Task().resume()</font></div><font size="2" class=""><font class=""><font class=""><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div dir="ltr" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal;" class=""><br class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Output with the latest master:</font></div><div dir="ltr" style="font-style: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" color="#0000cc" class="">before =&gt; ready(Test.TState(drain: Test.Drain.foo("wow")))</font></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" color="#0000cc" class="">after =&gt; ready(Test.TState(drain: Test.Drain.foo("wow")))</font></span></div><div style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><br class=""></div></div><div dir="ltr" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Expected output (and with the 04-24 snapshot as well):</font></div><div dir="ltr" style="font-style: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" color="#0000cc" class="">before =&gt; ready(Test.TState(drain: Test.Drain.foo("wow")))</font></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" color="#0000cc" class="">after =&gt; inProgress(Test.TState(drain: Test.Drain.foo("wow")))</font></span></div><div style="font-size: 14px; font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="font-size: 14px; font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div><div dir="ltr" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Pushkar N Kulkarni,</font></div><div dir="ltr" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">IBM Runtimes</font></div><div dir="ltr" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class=""><br class=""></font></div><div dir="ltr" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><font face="serif, Times New Roman, Times, serif" class=""><i class="">Simplicity is prerequisite for reliability - Edsger W. Dijkstra</i></font></div><div dir="ltr" style="font-size: 10.5pt; font-family: Arial; font-style: normal;" class=""><br class=""></div></div></div></div></font></font></font></div><br class=""><br class=""><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" style="font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><font color="#990099" class=""><a href="mailto:-----rjmccall@apple.com" target="_blank" class="">-----rjmccall@apple.com</a> wrote: -----</font><div class="iNotesHistory" style="padding-left:5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;" class="">To: Pushkar N Kulkarni &lt;<a href="mailto:pushkar.nk@in.ibm.com" target="_blank" class="">pushkar.nk@in.ibm.com</a>&gt;<br class="">From: John McCall <!--Notes ACF
<rjmccall@apple.com>--><br class="">Sent by: <a href="mailto:rjmccall@apple.com" target="_blank" class="">rjmccall@apple.com</a><br class="">Date: 05/10/2017 04:19AM<br class="">Cc: swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a>&gt;<br class="">Subject: Re: [swift-dev] Property modification not taking effect<br class=""><br class=""><!--Notes ACF
<meta http-equiv="Content-Type" content="text/html charset=utf8">--><div class=""><blockquote type="cite" class=""><div class="">On May 9, 2017, at 3:07 PM, Pushkar N Kulkarni via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><div class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">In the process of debugging a bunch of consistent failures in TestFoundation/TestNSURLSession, I came across a weird problem symptom in <a target="_blank" href="https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSURLSession/NSURLSessionTask.swift#L329" title="https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSURLSession/NSURLSessionTask.swift#L329" class="">this line of code</a>.</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class="">internalState </font></span><span class="pl-k" style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;"><font color="#a71d5d" class="">=</font></span><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class=""> .</font></span><span class="pl-c1" style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;"><font color="#0086b3" class="">transferInProgress</font></span><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class="">(transferState)</font></span><br class=""></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><span style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;" class=""><font color="#24292e" class=""><br class=""></font></span></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">I had a suspicion that the above modification is not taking effect, since, only based on this change the didSet observer for the `internalState` property triggers data transfers using libcurl. So, I simply printed the property before and after the assignment.&nbsp;</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" class="">print("before =&gt; \(internalState)")</font></div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" class=""><span style="white-space: pre;" class=""><font color="#24292e" class="">internalState </font></span><span class="pl-k" style="box-sizing: border-box; white-space: pre;"><font color="#a71d5d" class="">=</font></span><span style="white-space: pre;" class=""><font color="#24292e" class=""> .</font></span><span class="pl-c1" style="box-sizing: border-box; white-space: pre;"><font color="#0086b3" class="">transferInProgress</font></span><span style="white-space: pre;" class=""><font color="#24292e" class="">(transferState)</font></span><br class=""></font></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" class="">print("after =&gt; \(internalState)")</font></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" class=""><br class=""></font></span></div></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">Surprisingly, I don't see any change in the property value:</div><div class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">before =&gt; transferReady(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))<br class=""></font></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">after &nbsp;=&gt; transferReady(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))</font></span></div></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></div><div class=""><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size: small;" class="">When I switched back to the "</font><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" size="2" class="">swift-DEVELOPMENT-SNAPSHOT-2017-04-24-a"</font><span style="font-size: 14px; font-family: Menlo;" class="">&nbsp;</span><font face="Verdana, Arial, Helvetica, sans-serif" style="font-size: small;" class="">tag on all the repos (except swift-corelibs-foundation), I do not see this problem. I see:</font></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">before =&gt; transferReady(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))</font></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="monospace, Courier New, Courier, monospace" size="2" color="#0000ff" class="">after &nbsp;=&gt; transferInProgress(Foundation.URLSessionTask._TransferState(... &lt;redacted&gt; ...))</font></span></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">To put it in simple terms, the modification doesn't seem to be taking effect with the current HEAD.&nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">I haven't been able to isolate this problem in an independent test case. However, anybody who wants to reproduce it can simply run TestFoundation after enabling the URLSession tests (which have been disabled for now) in TestFoundation/main.swift.&nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">I did compare the `-emit-ir` outputs from the passing and failing levels. There seems to be a clear difference in the way we store the new value of this property. But given my limited exposure to debugging Swift compiler issues, I wasn't able to progress further. &nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;" class="">&nbsp;</span><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><font face="Verdana, Arial, Helvetica, sans-serif" size="2" class="">Can someone help us here please? Thanks.&nbsp;</font></div></div></font></div></blockquote><div class=""><br class=""></div></div>That sounds like a serious bug; please file it in JIRA.<div class=""><br class=""></div><div class="">John.</div><!--Notes ACF
</rjmccall@apple.com>--></div></div></font></font><br class="">
<div class=""><font face="Courier New,Courier,monospace" size="3" class="">_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class=""></font></div></swift-dev@swift.org></div></div></font></font><br class="">

</div></blockquote></div><br class=""></body></html>