[swift-dev] Help with SR-1052: Handling generic return values

Trent Nadeau tanadeau at gmail.com
Tue May 3 20:28:20 CDT 2016


Can anyone help me with this?

On Fri, Apr 22, 2016 at 6:43 PM, Trent Nadeau <tanadeau at gmail.com> wrote:

> Could someone who knows the generics system better than I give me a
> pointer for my question in https://bugs.swift.org/browse/SR-1052 (support
> for @discardableResult attribute)?
>
> Question:
>
> 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:
>
> public mutating func withMutableCharacters<R>(_ body: (inout
> CharacterView) -> R) -> R
>
> where the return type is generic.
>
> For regular functions, I can skip the warning if the result type in the
> decl is Void.
>
> Any ideas on how to tell if a call to a generic function like
> withMutableCharacters has a return type of Void in context?
>
> My branch with the work for Part 5 so far is at
> https://github.com/tanadeau/swift/commits/sr-1052-use-attr.
>
> --
> Trent Nadeau
>



-- 
Trent Nadeau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160503/85fc2716/attachment.html>


More information about the swift-dev mailing list