<div dir="ltr">Can anyone help me with this?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 22, 2016 at 6:43 PM, Trent Nadeau <span dir="ltr"><<a href="mailto:tanadeau@gmail.com" target="_blank">tanadeau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Could someone who knows the generics system better than I give me a pointer for my question in <a href="https://bugs.swift.org/browse/SR-1052" target="_blank">https://bugs.swift.org/browse/SR-1052</a> (support for @discardableResult attribute)?<div><br></div><div>Question:<br><br><p style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px;background-color:rgb(245,245,245)">I'm starting to look at Part 5 (having the compiler use the new attr). What I have so far appears to be working with the exception of signatures like this:</p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px;background-color:rgb(245,245,245)"><tt style="border:1px solid rgb(204,204,204);border-radius:2px;padding:1px 3px;background-image:initial;background-repeat:initial">public mutating func withMutableCharacters<R>(_ body: (inout CharacterView) -> R) -> R</tt></p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px;background-color:rgb(245,245,245)">where the return type is generic.</p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px;background-color:rgb(245,245,245)">For regular functions, I can skip the warning if the result type in the decl is <tt style="border:1px solid rgb(204,204,204);border-radius:2px;padding:1px 3px;background-image:initial;background-repeat:initial">Void</tt>.</p><p style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px;background-color:rgb(245,245,245)">Any ideas on how to tell if a call to a generic function like <tt style="border:1px solid rgb(204,204,204);border-radius:2px;padding:1px 3px;background-image:initial;background-repeat:initial">withMutableCharacters</tt> has a return type of <tt style="border:1px solid rgb(204,204,204);border-radius:2px;padding:1px 3px;background-image:initial;background-repeat:initial">Void</tt> in context?</p><div><br></div><div>My branch with the work for Part 5 so far is at <a href="https://github.com/tanadeau/swift/commits/sr-1052-use-attr" target="_blank">https://github.com/tanadeau/swift/commits/sr-1052-use-attr</a>.</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div>Trent Nadeau</div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Trent Nadeau</div>
</div>