I always thought that this was a bug, but I can't find it on bugs.swift.org, so 
I'd love to know if it's meant to stay this way or not.

> Le 16 sept. 2017 à 06:32, Joanna Carter via swift-evolution 
> <[email protected]> a écrit :
> 
> Greetings
> 
> Old chestnut, sort of partially solved but still problems.
> 
> Now we can nest types in generic types, what I want is :
> 
> class Event<typeT>
> {
>  class Args
>  {
>    public static let empty = Args() // error : Static stored properties not 
> supported in generic types
>  }
> }
> 
> But the static let is not directly in the generic class.
> 
> So, I end up doing another convoluted workaround in the shape of :
> 
> class Event<typeT>
> {
>  class Args
>  {
>    public static var empty: Args
>    {
>      return Args()
>    }
>  }
> }
> 
> The main difference is that I have to create a new instance on every call to 
> Args.empty instead of returning the same one.
> 
> Is this an oversight or as intended, with the hope of fixing it in a future 
> version
> 
> Joanna
> 
> --
> Joanna Carter
> Carter Consulting
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to