[swift-users] Is this a compiler bug?

Howard Lovatt howard.lovatt at gmail.com
Mon Sep 4 21:23:09 CDT 2017


Thanks for prompt reply - link is:

https://bugs.swift.org/browse/SR-5838


  -- Howard.

On 5 September 2017 at 11:58, Slava Pestov <spestov at apple.com> wrote:

> Yeah, looks like a bug. Do you mind filing a JIRA?
>
> Slava
>
> On Sep 4, 2017, at 8:55 PM, Howard Lovatt via swift-users <
> swift-users at swift.org> wrote:
>
> Hi All,
>
> Is this a compiler bug?
>
> struct Box<T> {
>     var value: T
>     init(_ value: T) { self.value = value }
>     /// Unboxing operator.
>     static func >> <T>(left: Box<T>, right: inout T?) {
>         right = left.value
>     }
> }
>
> var u: String?
> let b = Box("Test")
> b >> &u // ERROR: Cannot convert value of type 'Box<String>' to expected
> argument type 'Box<_>'
>
> Am I missing something?
>
> Thanks in advance for any help,
>   -- Howard.
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170905/bafd91c3/attachment.html>


More information about the swift-users mailing list