sq/JSIL — pull request #476 by iskiselev (2014-05-06 21:45:56+00:00)
Title: Possible fix for incorrect selecting method FastOverloadDispatch (#368)

I thought little bit more on #368.
Fix that I suggest in #474 is good for fixing symptoms of problem (and it is really necessary as it fix DynamicDispatcher, that can be used with JSRuntimeDispatch).
But really it mask problem. Let's look on translation of suggested test before current fix:
```
function Program_Main (args) {
var br = new $asm00.BaseResult();
var dr = new $asm00.DerivedResult();
var bas = new $asm00.Base();
var derived = new $asm00.Derived();
$S00().CallVirtual("Method", null, bas);
bas.AnotherMethod();
$S01().CallVirtual("MethodWithParameter1", null, bas, br);
$S01().CallVirtual("MethodWithParameter1", null, bas, dr);
$S02().CallVirtual("MethodWithParameter2", null, bas, dr);
bas = derived;
$S00().CallVirtual("Method", null, bas);
bas.AnotherMethod();
$S01().CallVirtual("MethodWithParameter1", null, bas, br);
$S01().CallVirtual("MethodWithParameter1", null, bas, dr);
$S02().CallVirtual("MethodWithParameter2", null, bas, dr);
derived.Method();
derived.AnotherMethod();
$S01().CallVirtual("MethodWithParameter1", null, derived, br);
derived.MethodWithParameter1(dr);
derived.MethodWithParameter2(br);
derived.MethodWithParameter2(dr);
};
```

Here we see, that JSIL select explicit signature method call for method from Base class (as they have same name methods in Derived class and Base instance could be Derived). But at the same time, it select FastDipatcher for methods from Derived class - that is incorrect and will fall back to DynamicDispatcher on JS runtime.

This work in such way, as TypeInfo.DoDeferredMethodSignatureSetUpdate add each method signature from derived class to base MethodSignatures collection (so, that in final object MethodSignatures will have all method signatures from all types). At the same time, it haven't added base method signatures to derived class. So, when used dispatcher was selected for derived class, it had no information, that method with same name, but another signature was present in base class.

Here is fix, that looks like solving this problem. I'm not fully sure, that it is good in all points, so I'd like to here some feedback. All tests are passed, so I suppose it should not break anything.