[swift-users] Is this a compiler bug?

Slava Pestov spestov at apple.com
Mon Sep 4 20:58:01 CDT 2017


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/20170904/349d50a1/attachment.html>


More information about the swift-users mailing list