On Jul 26, 10:04 pm, VladD2 <
v...@rsdn.ru> wrote:
Kamil, Michel...
How I understand in case of Kind.Overloaded (overloads) in
DoResolve.ExpectMember (name : string) : void
we should do standard overload resolution logic.
Right?
> I think bug in line 691 of
http://nemerle.org/svn/nemerle/trunk/ncc/typing
> /Typer-DelayedTyping.n: [^]
> | Kind.Overloaded (overloads) =>
> def expr = DtKind.filtering_expression;
> def o' =
> if (expr == null) {
> RemoveExtensionMethods (OverloadPossibility.OnlyPossible > > (overloads, expected))
> } else {
> ...
> It code wrong. It not choise bast overload or/and not exclude
> generic methods.
> I think in this place need call GetBestOverloads(), but it case
> some problem:
> 1. GetBestOverloads() which fail on permutation_array is null.
> 2. Sometime in code above "overloads" contains overloads with
> same count of args.
1. Is correct if I fill permutation_array array (in FormalTypes :
array [TyVar property) like this:
when (permutation_array == null)
{ // The permutation_array is null if func pass into other func.
permutation_array = array (formals.Length);
foreach (i in [0..permutation_array.Length - 1])
permutation_array[i] = i;
}
and remove line:
Util.cassert (formal_types != null || permutation_array != null);
?
2. Is correct if I
| Kind.Overloaded (overloads) =>
def expr = DtKind.filtering_expression;
def o' =
if (expr == null)
{
def res1 = OverloadPossibility.OnlyPossible (overloads, expected);
def res2 = if (checkForAllOverloadsSameCountofArgs(overloads))
typer.GetBestOverloads(res1);
else res1;
res2
instade:
| Kind.Overloaded (overloads) =>
def expr = DtKind.filtering_expression;
def o' =
if (expr == null)
{
RemoveExtensionMethods (OverloadPossibility.OnlyPossible
(overloads, expected))