Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-17 Thread Joe Groff via swift-evolution
> On Mar 16, 2017, at 8:27 PM, Slava Pestov via swift-evolution > wrote: > > Overload resolution has a lot of heuristics, but it’s not magic. It simply > doesn’t know how to handle this case. > > I’d be in favor of consolidating and simplifying the overload

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-17 Thread Ben Cohen via swift-evolution
> On Mar 17, 2017, at 3:27 AM, Slava Pestov via swift-evolution > wrote: > > Overload resolution has a lot of heuristics, but it’s not magic. It simply > doesn’t know how to handle this case. > I think this might this just be a bug in overload resolution that’s

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Slava Pestov via swift-evolution
> On Mar 16, 2017, at 8:36 PM, Jaden Geller wrote: > > >> On Mar 16, 2017, at 8:27 PM, Slava Pestov wrote: >> >> Overload resolution has a lot of heuristics, but it’s not magic. It simply >> doesn’t know how to handle this case. >> >> I’d be in

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Jaden Geller via swift-evolution
> On Mar 16, 2017, at 8:27 PM, Slava Pestov wrote: > > Overload resolution has a lot of heuristics, but it’s not magic. It simply > doesn’t know how to handle this case. > > I’d be in favor of consolidating and simplifying the overload resolution > rules, with the goal of

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Slava Pestov via swift-evolution
> On Mar 16, 2017, at 8:32 PM, Robert Bennett wrote: > > Agreed, I'm fine with a way of achieving this without T != Type. I suppose I > should have made the subject "Fix Swift's type checker in this particular > case". > > I still have trouble figuring out *how* it can

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Robert Bennett via swift-evolution
Agreed, I'm fine with a way of achieving this without T != Type. I suppose I should have made the subject "Fix Swift's type checker in this particular case". I still have trouble figuring out *how* it can correctly handle ambiguity in protocol extensions but be unable to in a "true"

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Slava Pestov via swift-evolution
Overload resolution has a lot of heuristics, but it’s not magic. It simply doesn’t know how to handle this case. I’d be in favor of consolidating and simplifying the overload resolution rules, with the goal of disambiguating common cases that are currently ambiguous. We might even be able to

Re: [swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Jaden Geller via swift-evolution
I would’ve expected overload resolution to pick the “more specific” one in this case without needing any additional constraints… 樂 > On Mar 16, 2017, at 6:40 PM, Robert Bennett via swift-evolution > wrote: > > Hello, > > This discussion sort of fizzled out when the

[swift-evolution] Revisiting 'T != Type' in where clause

2017-03-16 Thread Robert Bennett via swift-evolution
Hello, This discussion sort of fizzled out when the topic was first introduced. Joe Groff had asked the following: > Do you have a concrete example where you need this? It'd be good to know > whether the types are ambiguous due to type checker bugs, or whether there's > a principle by which