@Tarmean Welcome! Let me quickly reply to some of your points (sorry if I don't 
touch everything, I spent my train time on other topics this morning). The 
`c.keys()[int] is K` might be not the perfect solution, because `c.keys()` can 
be iterators (e.g., `for k in c.keys(): k is K` looks better). However, I get 
your point, I'm convinced that `c.keys()[int] is K` syntax needs to be 
supported.

I cannot comment on `Copyable and Comparable`. The syntax is nice, but I don't 
know its consequences.

Going to my example, let's assume that `myX` has a type which implements 
`Map[string,int]` and `Map[int,string]`. So these are valids: `myX["key"] + 5` 
and `"value = " & myX[5]`. Let me also assume (I haven't checked) that `5<6` is 
valid, but `5<"a"` and `"a"<5` and `"a"<"b"` are not valid nim code. Then this 
type clearly doesn't match `MapComperable[K,V]` for any `K` and `V` (because 
the candidates are: `[K=int,V=string]` and `[K=string,V=int]`, but in these 
cases `K` and `V` are not comperable). However, with the compiler rules that we 
are currently discussing, after `c[K] = V` the compiler might think that 
`K=int|string` and `V=string|int`. Looking at `K < V` the compiler will deduct 
that `K=int` and `V=int`, which is a wrong solution.
    Peter

Reply via email to