Re: [swift-evolution] [proposal] Generic type aliases

2016-03-21 Thread Adrian Zubarev via swift-evolution
Ok I read all the previous posts and I’m totally fine with this feature as it’s mentioned in its base form. Looking forward to see generic typealias allowing type constraints. There is one thing still on my mind: how do we use a generic typealias? typealias SomeTuple = (T, T) func foo(tuple:

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-20 Thread Andrew Bennett via swift-evolution
Big +1 on this proposal from me. Does this proposal allow a protocol can have generic associated types? - associatedtype Something - associatedtype Something It's not mentioned, but I think it would be necessary at some point for completeness. On Thu, Mar 17, 2016 at 2:32 PM, Joe Groff

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-19 Thread Joe Groff via swift-evolution
> On Mar 9, 2016, at 8:47 PM, Chris Lattner via swift-evolution > wrote: > > This is a minimal proposal for introducing type aliases into Swift, and > intentionally chooses to keep them limited to being “aliases”. As such, > additional constraints are not allowed

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-19 Thread Chris Lattner via swift-evolution
On Mar 16, 2016, at 4:56 PM, Joe Groff wrote: >> We shouldn’t infer it the requirement. >> >> Rationale: I see this as analogous (in two ways) to why we don’t infer >> hashability of T in: >> >> func f(…) { >> let x : Dictionary >> } > > However, we do infer the

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-19 Thread Russ Bishop via swift-evolution
> On Mar 9, 2016, at 8:47 PM, Chris Lattner via swift-evolution > wrote: > > This is a minimal proposal for introducing type aliases into Swift, and > intentionally chooses to keep them limited to being “aliases”. As such, > additional constraints are not allowed

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-19 Thread Chris Lattner via swift-evolution
> On Mar 16, 2016, at 12:23 PM, Russ Bishop wrote: > > >> On Mar 9, 2016, at 8:47 PM, Chris Lattner via swift-evolution >> > wrote: >> >> This is a minimal proposal for introducing type aliases into Swift, and >>

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-19 Thread Brent Royal-Gordon via swift-evolution
>> However, we do infer the `T: Hashable` in a case like this: >> >> func foo(x: Dictionary) {} >> >> `typealias` feels similar to that to me. It doesn't have to be a global >> analysis, just an analysis of the RHS of the typealias. > > I consider the RHS of the typealias to be the

Re: [swift-evolution] [proposal] Generic type aliases

2016-03-18 Thread Joe Groff via swift-evolution
> On Mar 16, 2016, at 5:02 PM, Chris Lattner wrote: > > On Mar 16, 2016, at 4:56 PM, Joe Groff > wrote: >>> We shouldn’t infer it the requirement. >>> >>> Rationale: I see this as analogous (in two ways) to why we don’t infer