Beispiel #1
0
 internal void AddApplicableMethod(FunctionObject f, IntegerList a, IntegerList param_mod, int res_id, ref FunctionObject best, ref IntegerList applicable_list)
 {
     if (best == null) {
         best = f;
     }
     if (((f.ParamCount <= a.Count) && ((f.ParamCount >= a.Count) || (f.ParamsId != 0))) && ((res_id == 0) || base.Scripter.MatchAssignment(f.ResultId, res_id))) {
         best = f;
         if (f.ParamCount == 0) {
             applicable_list.Add(f.Id);
         }
         else {
             bool flag = true;
             for (int i = 0; i < a.Count; i++) {
                 int num2 = a[i];
                 int paramId = f.GetParamId(i);
                 flag = ((int)f.GetParamMod(i) == param_mod[i]);
                 if (!flag && !f.Imported) {
                     if (base.Scripter.code.GetLanguage(base.Scripter.code.n) != CSLite_Language.VB) {
                         break;
                     }
                     flag = true;
                 }
                 flag = base.Scripter.MatchAssignment(paramId, num2);
                 if (!flag) {
                     if (base.Scripter.code.GetLanguage(base.Scripter.code.n) == CSLite_Language.VB) {
                         int typeId = base.Scripter.symbol_table[paramId].TypeId;
                         int id = base.Scripter.symbol_table[num2].TypeId;
                         ClassObject classObject = base.Scripter.GetClassObject(typeId);
                         ClassObject obj3 = base.Scripter.GetClassObject(id);
                         flag = base.Scripter.MatchTypes(classObject, obj3);
                     }
                     if (!flag) {
                         break;
                     }
                 }
             }
             if (flag) {
                 applicable_list.Add(f.Id);
             }
         }
     }
 }