[nem-en] overloads & inference

Dmitry Ivankov divanorama at gmail.com
Sun Jun 24 10:50:58 CEST 2007


Following breaks inference without user-defined operators:

_ = xx => match (xx) {
| (a : int, []) => a + 2 //or without :int
| (a, [x]) => (x + a) + 1
| (_, _) => 2
}

Is it expected? Shouldn't "a" from first case give type hint for second
case?

(x+a) stays unresolved with types ? and int++, while (x+a)+1 is resolved.
It can't resolve because int++ doesn't have any hint (but it has single
upper_tyvar), x hasn't any as well.

Minor hints on xx help, int*_   or   _*list[int]  for example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20070624/204d4961/attachment.html


More information about the devel-en mailing list