private void CheckOP_CALL(ClassObject current_class, int curr_level, IntegerList a, IntegerList param_mod, IntegerList pos) { FunctionObject obj10; int num35; bool flag8; int id = this.r.arg1; int n = this.n; a.Clear(); param_mod.Clear(); pos.Clear(); int num3 = 0; int avalue = this.n; while (true) { if (avalue <= 1) { this.scripter.CreateErrorObject("CS0001. Internal compiler error."); return; } if ((this[avalue].op == this.OP_BEGIN_CALL) && (this[avalue].arg1 == id)) { break; } avalue--; } this[avalue].op = this.OP_NOP; while (true) { if ((this[avalue].op == this.OP_PUSH) && (this[avalue].res == id)) { pos.Add(avalue); a.Add(this[avalue].arg1); param_mod.Add(this[avalue].arg2); if (this[avalue].arg2 > 0) { num3++; } } if (avalue == this.n) { break; } avalue++; } this.scripter.Dump(); MemberKind kind = this.symbol_table[id].Kind; if (kind == MemberKind.Type) { ClassObject val = (ClassObject) this.GetVal(id); if (val.IsDelegate) { if (a.Count == 1) { FunctionObject obj3 = this.GetFunctionObject(curr_level); this.InsertOperators(pos[0], 1); this.n++; this[pos[0]].op = this.OP_PUSH; this[pos[0]].arg1 = obj3.ThisId; this[pos[0]].arg2 = 0; this[pos[0]].res = val.Id; a.Insert(0, obj3.ThisId); } if (val.PatternMethod.Init == null) { FunctionObject patternMethod = val.PatternMethod; int last = a.Last; if (this.symbol_table[last].Kind == MemberKind.Ref) { int num6 = this.symbol_table[last].Level; int num7 = this.symbol_table[num6].TypeId; ClassObject classObjectEx = this.GetClassObjectEx(num7); int num8 = this.symbol_table[last].NameIndex; bool flag = this.GetUpcase(this.n); MemberObject memberByNameIndex = classObjectEx.GetMemberByNameIndex(num8, flag); this.ReplaceId(a.Last, memberByNameIndex.Id); a.Last = memberByNameIndex.Id; } FunctionObject g = this.GetFunctionObject(a.Last); this.CreatePatternMethod(patternMethod, g); } this[this.n].op = this.OP_SETUP_DELEGATE; this[this.n].arg1 = 0; this[this.n].arg2 = 0; this[this.n].res = 0; } else if (this.r.res > 0) { if ((a.Count == 1) && (this.GetLanguage(this.n) == CSLite_Language.Pascal)) { this.r.op = this.OP_CAST; this.r.arg2 = a[0]; this[this.n - 1].op = this.OP_NOP; this[pos[0]].op = this.OP_NOP; this.n--; } else { string str = this.symbol_table[this.r.arg1].Name; this.scripter.CreateErrorObjectEx("CS0119. '{0}' denotes a '{1}' which is not valid in the given context.", new object[] { str, "type" }); } } else { FunctionObject obj8; id = val.FindConstructorId(a, param_mod, out obj8); if (id != 0) { goto Label_17D6; } string str2 = val.Name; if (obj8 != null) { if (obj8.ParamCount == a.Count) { if ((obj8.ParamsId == 0) || (a.Count == 0)) { this.scripter.CreateErrorObjectEx("CS1502. The best overloaded method match for '{0}' has some invalid arguments.", new object[] { str2 }); return; } int num9 = a[a.Count - 1]; int num10 = this.symbol_table[num9].TypeId; if (CSLite_System.GetRank(this.symbol_table[num10].Name) != 0) { this.scripter.CreateErrorObjectEx("CS1502. The best overloaded method match for '{0}' has some invalid arguments.", new object[] { str2 }); return; } this.InsertActualArray(obj8, curr_level, pos, a); id = obj8.Id; n = this.n; goto Label_17D6; } if (a.Count < obj8.ParamCount) { if (obj8.ParamsId == 0) { this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { str2, a.Count }); } else { if ((a.Count + 1) == obj8.ParamCount) { this.InsertActualArray(obj8, curr_level, pos, a); id = obj8.Id; n = this.n; goto Label_17D6; } this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { str2, a.Count }); } } else { this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { str2, a.Count }); } } else { this.scripter.CreateErrorObjectEx("CS0143. The type '{0}' has no constructors defined.", new object[] { val.Name }); } } return; } if (kind != MemberKind.Method) { switch (kind) { case MemberKind.Constructor: { FunctionObject obj13; int num32 = this.symbol_table[id].Level; ClassObject obj12 = this.GetClassObject(num32); id = obj12.FindConstructorId(a, param_mod, out obj13); this.r.res = 0; if (id == 0) { this.scripter.CreateErrorObjectEx("CS0143. The type '{0}' has no constructors defined.", new object[] { obj12.Name }); } goto Label_17D6; } case MemberKind.Destructor: { int num33 = this.symbol_table[id].Level; ClassObject obj14 = this.GetClassObject(num33); id = obj14.FindDestructorId(a); this.r.res = 0; if (id != 0) { goto Label_17D6; } this.scripter.CreateErrorObjectEx("CS0117. '{0}' does not contain a definition for '{1}'.", new object[] { obj14.Name, "~" + obj14.Name }); return; } } if (kind != MemberKind.Ref) { switch (kind) { case MemberKind.Var: case MemberKind.Index: { int num55 = this.symbol_table[this.r.arg1].TypeId; ClassObject obj20 = this.GetClassObject(num55); if (((kind == MemberKind.Var) && (obj20.IsArray || obj20.IsPascalArray)) && this.PascalOrBasic(this.n)) { this.ConvertCallToIndexAccess(a, pos); return; } if (((kind == MemberKind.Var) && (obj20.DefaultProperty != null)) && this.PascalOrBasic(this.n)) { this.ConvertToDefaultPropertyCall(obj20.DefaultProperty, a, pos); return; } if ((kind == MemberKind.Property) && this.PascalOrBasic(this.n)) { this.ConvertToPropertyCall(a, pos); return; } if (!obj20.IsDelegate) { if (this.PascalOrBasic(this.n)) { this.ConvertCallToIndexAccess(a, pos); } else { string str9 = this.symbol_table[this.r.arg1].Name; this.scripter.CreateErrorObjectEx("CS0118. '{0}' denotes a '{1}' where a '{2}' was expected.", new object[] { str9, "variable", "method" }); } return; } if (this.PascalOrBasic(this.n)) { this[this.n - 1].arg1 = this.r.arg1; } id = obj20.PatternMethod.Id; goto Label_17D6; } } int num56 = this.symbol_table[this.r.arg1].TypeId; ClassObject obj21 = this.GetClassObject(num56); if (((kind == MemberKind.Field) && (obj21.IsArray || obj21.IsPascalArray)) && this.PascalOrBasic(this.n)) { this.ConvertCallToIndexAccess(a, pos); return; } if (((kind == MemberKind.Field) && (obj21.DefaultProperty != null)) && this.PascalOrBasic(this.n)) { this.ConvertToDefaultPropertyCall(obj21.DefaultProperty, a, pos); return; } if ((kind == MemberKind.Property) && this.PascalOrBasic(this.n)) { this.ConvertToPropertyCall(a, pos); return; } if (!obj21.IsDelegate) { string str10 = this.symbol_table[this.r.arg1].Name; this.scripter.CreateErrorObjectEx("CS0118. '{0}' denotes a '{1}' where a '{2}' was expected.", new object[] { str10, "variable", "method" }); return; } if ((kind == MemberKind.Field) && (obj21.ImportedType != null)) { int num57 = this.symbol_table[this.r.arg1].Level; if ((this.symbol_table[num57].Kind == MemberKind.Type) && (this.GetClassObject(num57).ImportedType != null)) { this.r.op = this.OP_DYNAMIC_INVOKE; return; } } this[this.n - 1].arg1 = this.r.arg1; id = obj21.PatternMethod.Id; } else { FunctionObject obj16; int num34 = this.symbol_table[id].Level; num35 = this[this.n - 1].arg1; this[this.n - 1].arg1 = num34; int num36 = this.symbol_table[id].NameIndex; string str6 = this.symbol_table[id].Name; int num37 = this.symbol_table[num34].TypeId; if (this.symbol_table[num37].Kind != MemberKind.Type) { string str7 = this.symbol_table[num37].Name; this.scripter.CreateErrorObjectEx("CS0246. The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?).", new object[] { str7 }); return; } ClassObject obj15 = this.GetClassObjectEx(num37); bool flag5 = this.GetUpcase(this.n); id = obj15.FindMethodId(num36, a, param_mod, 0, out obj16, flag5); if (id == 0) { if (obj16 == null) { int num51 = this.symbol_table[this.r.arg1].TypeId; if (this.symbol_table[num51].Kind != MemberKind.Type) { this.scripter.CreateErrorObjectEx("CS0117. '{0}' does not contain a definition for '{1}'.", new object[] { obj15.Name, str6 }); return; } ClassObject obj18 = this.GetClassObject(num51); if ((obj18.IsArray || obj18.IsPascalArray) && this.PascalOrBasic(this.n)) { this.ConvertCallToIndexAccess(a, pos); return; } if ((obj18.DefaultProperty != null) && this.PascalOrBasic(this.n)) { this.ConvertToDefaultPropertyCall(obj18.DefaultProperty, a, pos); return; } if (!obj18.IsDelegate) { if (this.PascalOrBasic(this.n)) { this.ConvertCallToIndexAccess(a, pos); } else { this.scripter.CreateErrorObjectEx("CS0117. '{0}' does not contain a definition for '{1}'.", new object[] { obj15.Name, str6 }); } return; } if (obj18.ImportedType != null) { int num52 = this.symbol_table[this.r.arg1].Level; int num53 = this.symbol_table[num52].TypeId; if (this.GetClassObject(num53).ImportedType != null) { this.r.op = this.OP_DYNAMIC_INVOKE; return; } } id = obj18.PatternMethod.Id; if (!this.PascalOrBasic(this.n)) { this[this.n - 1].arg1 = num35; goto Label_17D6; } int num54 = this.n; flag8 = false; while (true) { num54--; if ((this[num54].op == this.OP_RAISE_EVENT) && (this[num54].arg1 == this.r.arg1)) { flag8 = true; goto Label_143F; } if (num54 == 1) { goto Label_143F; } } } if (obj16.ParamCount != a.Count) { if ((a.Count < obj16.ParamCount) || (obj16.ParamsId == 0)) { if (obj16.Name == "Dispose") { for (int i = 0; i < pos.Count; i++) { this[pos[i]].op = this.OP_NOP; } this[this.n - 1].op = this.OP_NOP; this[this.n].op = this.OP_NOP; } else { this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { str6, a.Count }); } return; } this.InsertActualArray(obj16, curr_level, pos, a); id = obj16.Id; n = this.n; } else { bool flag6 = true; for (int j = 0; j < a.Count; j++) { int num39 = a[j]; int paramId = obj16.GetParamId(j); if (!this.scripter.MatchAssignment(paramId, num39)) { int num41 = this.symbol_table[num39].TypeId; ClassObject obj17 = this.GetClassObject(num41); int num42 = obj17.FindOverloadableImplicitOperatorId(num39, paramId); if (num42 == 0) { flag6 = false; break; } int num43 = this.n; this.n = pos[j]; int currMethodId = this.GetCurrMethodId(); int num45 = this.AppVar(currMethodId, this.symbol_table[paramId].TypeId); int res = this[this.n].res; this[this.n].arg1 = num45; this.InsertOperators(this.n, 3); this[this.n].op = this.OP_PUSH; this[this.n].arg1 = num39; this[this.n].arg2 = 0; this[this.n].res = num42; this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = obj17.Id; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL_SIMPLE; this[this.n].arg1 = num42; this[this.n].arg2 = 1; this[this.n].res = num45; this.n = num43 + 3; for (int k = j + 1; k < a.Count; k++) { pos[k] += 3; } } } if (!flag6) { if ((obj16.ParamsId == 0) || (a.Count == 0)) { this.scripter.CreateErrorObjectEx("CS1502. The best overloaded method match for '{0}' has some invalid arguments.", new object[] { str6 }); return; } int num48 = a[a.Count - 1]; int num49 = this.symbol_table[num48].TypeId; if (CSLite_System.GetRank(this.symbol_table[num49].Name) != 0) { this.scripter.CreateErrorObjectEx("CS1502. The best overloaded method match for '{0}' has some invalid arguments.", new object[] { str6 }); return; } this.InsertActualArray(obj16, curr_level, pos, a); } id = obj16.Id; n = this.n; } } } goto Label_17D6; } int nameIndex = this.symbol_table[id].NameIndex; string name = this.symbol_table[id].Name; int level = this.symbol_table[id].Level; ClassObject classObject = this.GetClassObject(level); bool upcase = this.GetUpcase(this.n); Label_0646: id = classObject.FindMethodId(nameIndex, a, param_mod, 0, out obj10, upcase); if (id != 0) { goto Label_17D6; } if (obj10 == null) { this.scripter.CreateErrorObjectEx("CS0117. '{0}' does not contain a definition for '{1}'.", new object[] { classObject.Name, name }); } else if (obj10.ParamCount != a.Count) { if (a.Count < obj10.ParamCount) { int num27; int defaultParamCount = obj10.DefaultParamCount; if ((a.Count + defaultParamCount) < obj10.ParamCount) { if (obj10.ParamsId == 0) { if (((a.Count + 1) == obj10.ParamCount) && (this.GetTypeId(obj10.Param_Ids[obj10.ParamCount - 1]) == 0x10)) { int num31; if (pos.Count > 0) { num31 = pos[a.Count - 1] + 1; } else { num31 = this.n - 2; } this.InsertOperators(num31, 1); this[num31].op = this.OP_PUSH; this[num31].arg1 = this.symbol_table.NULL_id; this[num31].arg2 = 0; this[num31].res = 0; this.n++; id = obj10.Id; goto Label_0C98; } this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { name, a.Count }); } else { if ((a.Count + 1) == obj10.ParamCount) { this.InsertActualArray(obj10, curr_level, pos, a); id = obj10.Id; n = this.n; goto Label_0C98; } this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { name, a.Count }); } return; } int number = obj10.ParamCount - a.Count; if (pos.Count > 0) { num27 = pos[a.Count - 1] + 1; } else { num27 = this.n - 2; } ProgRec rec1 = this[this.n]; rec1.arg2 += number; this.InsertOperators(num27, number); int num28 = obj10.ParamCount - number; for (int m = 0; m < number; m++) { int num30 = obj10.Default_Ids[num28]; a.Add(num30); pos.Add(num27); param_mod.Add(obj10.Param_Mod[num28]); this[num27].op = this.OP_PUSH; this[num27].arg1 = num30; this[num27].arg2 = 0; this[num27].res = obj10.Id; num27++; this.n++; num28++; } this.r = this[this.n]; n = this.n; goto Label_0646; } this.InsertActualArray(obj10, curr_level, pos, a); id = obj10.Id; n = this.n; } else { bool flag3 = true; for (int num13 = 0; num13 < a.Count; num13++) { int num14 = a[num13]; int num15 = obj10.GetParamId(num13); if (!this.scripter.MatchAssignment(num15, num14)) { int num16 = this.symbol_table[num14].TypeId; ClassObject obj11 = this.GetClassObject(num16); int num17 = obj11.FindOverloadableImplicitOperatorId(num14, num15); if (num17 == 0) { flag3 = false; break; } int num18 = this.n; this.n = pos[num13]; int num19 = this.GetCurrMethodId(); int num20 = this.AppVar(num19, this.symbol_table[num15].TypeId); int num21 = this[this.n].res; this[this.n].arg1 = num20; this.InsertOperators(this.n, 3); this[this.n].op = this.OP_PUSH; this[this.n].arg1 = num14; this[this.n].arg2 = 0; this[this.n].res = num17; this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = obj11.Id; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL_SIMPLE; this[this.n].arg1 = num17; this[this.n].arg2 = 1; this[this.n].res = num20; this.n = num18 + 3; for (int num22 = num13 + 1; num22 < a.Count; num22++) { pos[num22] += 3; } } } if (flag3) { id = obj10.Id; n = this.n; goto Label_17D6; } if ((obj10.ParamsId == 0) || (a.Count == 0)) { this.scripter.CreateErrorObjectEx("CS1502. The best overloaded method match for '{0}' has some invalid arguments.", new object[] { name }); return; } int num23 = a[a.Count - 1]; int num24 = this.symbol_table[num23].TypeId; if (CSLite_System.GetRank(this.symbol_table[num24].Name) != 0) { this.scripter.CreateErrorObjectEx("CS1502. The best overloaded method match for '{0}' has some invalid arguments.", new object[] { name }); return; } this.InsertActualArray(obj10, curr_level, pos, a); id = obj10.Id; n = this.n; } Label_0C98: if (id != 0) { goto Label_17D6; } return; Label_143F: if (flag8) { this[this.n - 1].arg1 = num35; } else { this[this.n - 1].arg1 = this.r.arg1; } Label_17D6: this.r.arg1 = id; for (avalue = 0; avalue < pos.Count; avalue++) { this[pos[avalue]].res = id; } int typeId = this.symbol_table[this.r.arg1].TypeId; if (typeId == 1) { this.r.res = 0; } else if (this.symbol_table[this.r.arg1].Name != "get_Current") { this.symbol_table[this.r.res].TypeId = typeId; } bool flag9 = false; string str11 = ""; string str12 = ""; FunctionObject functionObject = this.GetFunctionObject(id); if (functionObject.Static) { int num59 = this.symbol_table[id].Level; this[n - 1].arg1 = num59; } if (!functionObject.Imported && (a.Count > 0)) { avalue = 0; while (avalue < functionObject.ParamCount) { ParamMod paramMod = functionObject.GetParamMod(avalue); ParamMod mod2 = (ParamMod) param_mod[avalue]; if (paramMod != mod2) { int num60 = functionObject.GetParamId(avalue); int num61 = this[this.n].arg1; int num62 = this.symbol_table[num60].TypeId; int num63 = this.symbol_table[num61].TypeId; str11 = this.symbol_table[num62].Name; str12 = this.symbol_table[num63].Name; switch (paramMod) { case ParamMod.RetVal: str11 = "ref " + str11; break; case ParamMod.Out: str11 = "out " + str11; break; } if (mod2 == ParamMod.RetVal) { str12 = "ref " + str12; } else if (mod2 == ParamMod.Out) { str12 = "out " + str12; } flag9 = true; if (flag9 && this.PascalOrBasic(this.n)) { flag9 = false; if (paramMod == ParamMod.RetVal) { param_mod[avalue] = (int) paramMod; num3++; } } else { this.n = pos[avalue]; break; } } avalue++; } } if (flag9) { this.scripter.CreateErrorObjectEx("CS1503. Argument '{0}': cannot convert from '{1}' to '{2}'.", new object[] { avalue + 1, str12, str11 }); } else if ((num3 > 0) && (a.Count > 0)) { this.InsertOperators(this.n + 1, num3 * 2); for (avalue = 0; avalue < functionObject.ParamCount; avalue++) { int num64 = functionObject.GetParamId(avalue); if (param_mod[avalue] != 0) { int num65 = this.AppVar(this.symbol_table[id].Level, this.symbol_table[num64].TypeId); this.n++; this[this.n].op = this.OP_GET_PARAM_VALUE; this[this.n].arg1 = id; this[this.n].arg2 = avalue; this[this.n].res = num65; this.n++; this[this.n].op = this.OP_ASSIGN; this[this.n].arg1 = a[avalue]; this[this.n].arg2 = num65; this[this.n].res = a[avalue]; } } } }
private void Parse_PropertyMemberDeclaration(int class_id, ModifierList ml, ModifierList owner_modifiers, ClassKind ck) { base.DECLARE_SWITCH = true; this.Match("property"); int num = this.Parse_Ident(); this.param_ids.Clear(); this.param_type_ids.Clear(); this.param_mods.Clear(); IntegerList list = new IntegerList(true); if (base.IsCurrText('[')) { this.Match('['); if (!base.IsCurrText(']')) { this.Parse_ParameterList(num, false); } this.Match(']'); } base.DECLARE_SWITCH = false; this.Match(":"); int num2 = this.Parse_Type(); base.DiscardInstruction(base.code.OP_ASSIGN_TYPE, num, -1, -1); this.Gen(base.code.OP_ASSIGN_TYPE, num, num2, 0); int id = 0; int iD = 0; if (base.IsCurrText("read")) { this.Call_SCANNER(); id = this.Parse_Ident(); string name = base.GetName(id); base.DiscardInstruction(base.code.OP_EVAL, 0, 0, id); base.SetName(id, ""); id = base.LookupID(name); if (id == 0) { base.RaiseErrorEx(true, "Undeclared identifier '{0}'", new object[] { name }); } } if (base.IsCurrText("write")) { this.Call_SCANNER(); iD = this.Parse_Ident(); string s = base.GetName(iD); base.DiscardInstruction(base.code.OP_EVAL, 0, 0, iD); base.SetName(iD, ""); iD = base.LookupID(s); if (iD == 0) { base.RaiseErrorEx(true, "Undeclared identifier '{0}'", new object[] { s }); } } base.BeginProperty(num, ml, num2, 0); if (id > 0) { this.valid_this_context = true; int num5 = base.NewVar(); base.SetName(num5, "get_" + base.GetName(num)); this.BeginMethod(num5, MemberKind.Method, ml, num2); list.Clear(); for (int i = 0; i < this.param_ids.Count; i++) { base.DiscardInstruction(base.code.OP_ADD_PARAM, num, -1, -1); int num7 = base.NewVar(); base.SetName(num7, base.GetName(this.param_ids[i])); this.Gen(base.code.OP_ASSIGN_TYPE, num7, this.param_type_ids[i], 0); this.Gen(base.code.OP_ADD_PARAM, num5, num7, 0); list.Add(num7); } this.InitMethod(num5); if (base.GetKind(id) == MemberKind.Method) { int res = base.NewRef(base.GetName(id)); this.Gen(base.code.OP_CREATE_REFERENCE, base.CurrThisID, 0, res); this.Gen(base.code.OP_BEGIN_CALL, res, 0, 0); for (int j = 0; j < this.param_ids.Count; j++) { this.Gen(base.code.OP_PUSH, list[j], 0, res); } this.Gen(base.code.OP_PUSH, base.CurrThisID, 0, 0); this.Gen(base.code.OP_CALL, res, this.param_ids.Count, base.CurrResultId); } else if (base.GetKind(id) == MemberKind.Field) { if (this.param_ids.Count > 0) { base.RaiseError(false, "PAS0002. Incompatible types"); } int num10 = base.NewRef(base.GetName(id)); this.Gen(base.code.OP_CREATE_REFERENCE, base.CurrThisID, 0, num10); this.Gen(base.code.OP_ASSIGN, base.CurrResultId, num10, base.CurrResultId); } else { base.RaiseError(false, "PAS0001. Field or method identifier expected"); } this.EndMethod(num5); this.Gen(base.code.OP_ADD_READ_ACCESSOR, num, num5, 0); this.valid_this_context = false; } if (iD > 0) { int num12; this.valid_this_context = true; int num11 = base.NewVar(); base.SetName(num11, "set_" + base.GetName(num)); this.BeginMethod(num11, MemberKind.Method, ml, num2); list.Clear(); for (int k = 0; k < this.param_ids.Count; k++) { base.DiscardInstruction(base.code.OP_ADD_PARAM, num, -1, -1); num12 = base.NewVar(); base.SetName(num12, base.GetName(this.param_ids[k])); this.Gen(base.code.OP_ASSIGN_TYPE, num12, this.param_type_ids[k], 0); this.Gen(base.code.OP_ADD_PARAM, num11, num12, 0); list.Add(num12); } num12 = base.NewVar(); base.SetName(num12, "value"); this.Gen(base.code.OP_ADD_PARAM, num11, num12, 0); this.Gen(base.code.OP_ASSIGN_TYPE, num12, num2, 0); list.Add(num12); this.InitMethod(num11); if (base.GetKind(iD) == MemberKind.Method) { int num14 = base.NewRef(base.GetName(iD)); this.Gen(base.code.OP_CREATE_REFERENCE, base.CurrThisID, 0, num14); this.Gen(base.code.OP_BEGIN_CALL, num14, 0, 0); for (int m = 0; m < list.Count; m++) { this.Gen(base.code.OP_PUSH, list[m], 0, num14); } this.Gen(base.code.OP_PUSH, base.CurrThisID, 0, 0); this.Gen(base.code.OP_CALL, num14, list.Count, base.CurrResultId); } else if (base.GetKind(iD) == MemberKind.Field) { if (this.param_ids.Count > 0) { base.RaiseError(false, "PAS0002. Incompatible types"); } int num16 = base.NewRef(base.GetName(iD)); this.Gen(base.code.OP_CREATE_REFERENCE, base.CurrThisID, 0, num16); this.Gen(base.code.OP_ASSIGN, num16, num12, num16); } else { base.RaiseError(false, "PAS0001. Field or method identifier expected"); } this.EndMethod(num11); this.Gen(base.code.OP_ADD_WRITE_ACCESSOR, num, num11, 0); this.valid_this_context = false; } this.Match(";"); if (base.IsCurrText("default")) { this.Call_SCANNER(); if (this.param_ids.Count == 0) { base.RaiseError(false, "VB00004. Properties with no required parameters cannot be declared 'Default'."); } else { this.Gen(base.code.OP_SET_DEFAULT, num, 0, 0); } this.Match(";"); } base.EndProperty(num); base.DECLARE_SWITCH = true; }
public void CheckTypesEx(int init_n, int init_level, IntegerStack init_class_stack) { ClassObject classObject; IntegerStack stack; FunctionObject obj9; int num52; if (this.scripter.IsError()) { return; } IntegerList a = new IntegerList(true); IntegerList list2 = new IntegerList(true); IntegerList pos = new IntegerList(true); IntegerList list4 = new IntegerList(false); IntegerList l = new IntegerList(false); ClassObject obj2 = null; if (init_class_stack == null) { stack = new IntegerStack(); } else { stack = init_class_stack.Clone(); } if (stack.Count == 0) { classObject = null; } else { classObject = this.GetClassObject(stack.Peek()); } this.n = init_n; int num = init_level; Label_0079: this.n++; if (this.n >= this.Card) { goto Label_22C6; } this.r = (ProgRec) this.prog[this.n]; int op = this.r.op; if ((op == this.OP_SEPARATOR) || (op == this.OP_LABEL)) { goto Label_0079; } if (op != this.OP_CREATE_INDEX_OBJECT) { if (op == this.OP_ADD_INDEX) { if (((this.symbol_table[this.r.res].TypeId != 12) || (this[this.n + 1].op != this.OP_ADD_INDEX)) || (this[this.n + 1].res != this.r.res)) { goto Label_04A6; } int num7 = 1; while ((this[this.n + num7].op == this.OP_ADD_INDEX) && (this[this.n + num7].res == this.r.res)) { num7++; } this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { "this", num7 }); goto Label_22C6; } if (op == this.OP_SETUP_INDEX_OBJECT) { int n = this.n; int num9 = 0; do { n--; if ((this[n].op == this.OP_ADD_INDEX) && (this[n].arg1 == this.r.arg1)) { num9++; } } while ((this[n].op != this.OP_CREATE_INDEX_OBJECT) || (this[n].res != this.r.arg1)); int typeId = this.symbol_table[this[n].arg1].TypeId; int rank = CSLite_System.GetRank(this.symbol_table[typeId].Name); if ((rank > 0) && (rank != num9)) { this.scripter.CreateErrorObjectEx("CS0022. Wrong number of indices inside [], expected '{0}'.", new object[] { rank.ToString() }); goto Label_22C6; } } } else { int num3 = this.symbol_table[this.r.arg1].TypeId; string name = this.symbol_table[num3].Name; string elementTypeName = CSLite_System.GetElementTypeName(name); int num4 = 0; PropertyObject obj4 = null; if (elementTypeName == "") { ClassObject obj5 = this.GetClassObject(num3); if (obj5.IsPascalArray) { name = obj5.ImportedType.Name + "[]"; elementTypeName = this.symbol_table[obj5.IndexTypeId].Name; } } if (elementTypeName == "") { obj4 = this.GetClassObject(num3).FindIndexer(); if (obj4 == null) { this.scripter.CreateErrorObjectEx("CS0021. Cannot apply indexing with [] to an expression of type '{0}'.", new object[] { name }); goto Label_22C6; } num4 = this.symbol_table[obj4.Id].TypeId; } else { for (int k = num3; k >= 0; k--) { if ((this.symbol_table[k].Kind == MemberKind.Type) && (this.symbol_table[k].Name == elementTypeName)) { num4 = k; break; } } } if (num4 == 0) { elementTypeName = CSLite_System.GetElementTypeName(this.symbol_table[num3].FullName); bool upcase = this.GetUpcase(); MemberObject obj6 = this.FindType(this.RecreateLevelStack(this.n), elementTypeName, upcase); if (obj6 == null) { this.scripter.CreateErrorObjectEx("CS0246. The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?).", new object[] { elementTypeName }); goto Label_22C6; } num4 = obj6.Id; } this.symbol_table[this.r.res].TypeId = num4; } Label_04A6: if (((op == this.OP_CREATE_INDEX_OBJECT) || (op == this.OP_ADD_INDEX)) || (op == this.OP_SETUP_INDEX_OBJECT)) { goto Label_0079; } for (int i = 1; i <= 2; i++) { int num13; if (i == 1) { num13 = this.r.arg1; } else { num13 = this.r.arg2; } if (this.symbol_table[num13].Kind == MemberKind.Index) { l.Clear(); int avalue = this.n; while (true) { if ((this[avalue].op == this.OP_CREATE_INDEX_OBJECT) && (this[avalue].res == num13)) { break; } avalue--; } int num15 = this[avalue].arg1; l.Add(avalue); int num16 = this.symbol_table[num15].TypeId; PropertyObject obj8 = this.GetClassObject(num16).FindIndexer(); if (obj8 != null) { while (true) { if ((this[avalue].op == this.OP_SETUP_INDEX_OBJECT) && (this[avalue].arg1 == num13)) { break; } if ((this[avalue].op == this.OP_ADD_INDEX) && (this[avalue].arg1 == num13)) { l.Add(avalue); } avalue++; } l.Add(avalue); if ((this.r.op == this.OP_ASSIGN) && (i == 1)) { if (obj8.WriteId == 0) { this.scripter.CreateErrorObject("CS0154. The property or indexer '{0}' cannot be used in this context because it lacks the get accessor."); break; } int num17 = this.r.arg2; this.InsertOperators(this.n, obj8.ParamCount + 3); this.n--; this.n++; this[this.n].op = this.OP_BEGIN_CALL; this[this.n].arg1 = obj8.WriteId; this[this.n].arg2 = 0; this[this.n].res = 0; for (int m = 1; m < (l.Count - 1); m++) { this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = this[l[m]].arg2; this[this.n].arg2 = 0; this[this.n].res = obj8.WriteId; } this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = num17; this[this.n].arg2 = 0; this[this.n].res = obj8.WriteId; this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = num15; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL_BASE; this[this.n].arg1 = obj8.WriteId; this[this.n].arg2 = l.Count - 1; this[this.n].res = 0; this.r = (ProgRec) this.prog[this.n]; op = this.r.op; } else { if (obj8.ReadId == 0) { this.scripter.CreateErrorObject("CS0154. The property or indexer '{0}' cannot be used in this context because it lacks the get accessor."); break; } int num19 = this.AppVar(this.symbol_table[num13].Level, this.symbol_table[num13].TypeId); if (i == 1) { this.r.arg1 = num19; } else { this.r.arg2 = num19; } this.InsertOperators(this.n, obj8.ParamCount + 3); this.n--; this.n++; this[this.n].op = this.OP_BEGIN_CALL; this[this.n].arg1 = obj8.ReadId; this[this.n].arg2 = 0; this[this.n].res = 0; for (int num20 = 1; num20 < (l.Count - 1); num20++) { this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = this[l[num20]].arg2; this[this.n].arg2 = 0; this[this.n].res = obj8.ReadId; } this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = num15; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL_BASE; this[this.n].arg1 = obj8.ReadId; this[this.n].arg2 = l.Count - 2; this[this.n].res = num19; this.symbol_table[this[this.n].res].TypeId = this.symbol_table[obj8.ReadId].TypeId; this.r = (ProgRec) this.prog[this.n]; op = this.r.op; } list4.AddFrom(l); } } } if (op == this.OP_CREATE_METHOD) { num = this.r.arg1; goto Label_0079; } if (op != this.OP_CALL_SIMPLE) { if ((op == this.OP_CALL) || (op == this.OP_CALL_BASE)) { this.CheckOP_CALL(classObject, num, a, list2, pos); if (!this.scripter.IsError()) { goto Label_0079; } goto Label_22C6; } if (op == this.OP_CHECK_STRUCT_CONSTRUCTOR) { ClassObject obj12 = this.GetClassObject(this.r.arg1); if (obj12.IsStruct && !obj12.Imported) { FunctionObject obj13; this.r.op = this.OP_CREATE_OBJECT; int num35 = obj12.FindConstructorId(null, null, out obj13); if (num35 == 0) { this.scripter.CreateErrorObjectEx("CS0143. The type '{0}' has no constructors defined.", new object[] { obj12.Name }); } this.n++; this.InsertOperators(this.n, 2); this[this.n].op = this.OP_PUSH; this[this.n].arg1 = this.r.res; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL; this[this.n].arg1 = num35; this[this.n].arg2 = 0; this[this.n].res = 0; } else { this.r.op = this.OP_NOP; } } else if (op == this.OP_INSERT_STRUCT_CONSTRUCTORS) { ClassObject obj14 = this.GetClassObject(this.r.arg1); for (int num36 = 0; num36 < obj14.Members.Count; num36++) { MemberObject obj15 = obj14.Members[num36]; if (obj15.Kind == MemberKind.Field) { int num37 = this.symbol_table[obj15.Id].TypeId; ClassObject obj16 = this.GetClassObject(num37); if (obj16.IsStruct && !obj16.Imported) { if (obj16.IsPascalArray) { this.n++; this.InsertOperators(this.n, 1); this[this.n].op = this.OP_CREATE_OBJECT; this[this.n].arg1 = num37; this[this.n].arg2 = 0; this[this.n].res = obj15.Id; } else { FunctionObject obj17; int num38 = obj16.FindConstructorId(null, null, out obj17); if (num38 == 0) { this.scripter.CreateErrorObjectEx("CS0143. The type '{0}' has no constructors defined.", new object[] { obj16.Name }); } this.n++; this.InsertOperators(this.n, 3); this[this.n].op = this.OP_CREATE_OBJECT; this[this.n].arg1 = num37; this[this.n].arg2 = 0; this[this.n].res = obj15.Id; this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = obj15.Id; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL; this[this.n].arg1 = num38; this[this.n].arg2 = 0; this[this.n].res = 0; } } } } } else { if (op == this.OP_CAST) { this.CheckOP_CAST(); if (!this.scripter.IsError()) { goto Label_0079; } goto Label_22C6; } if (op == this.OP_TO_SBYTE) { this.symbol_table[this.r.res].TypeId = 10; } else if (op == this.OP_TO_BYTE) { this.symbol_table[this.r.res].TypeId = 3; } else if (op == this.OP_TO_USHORT) { this.symbol_table[this.r.res].TypeId = 15; } else if (op == this.OP_TO_SHORT) { this.symbol_table[this.r.res].TypeId = 11; } else if (op == this.OP_TO_UINT) { this.symbol_table[this.r.res].TypeId = 13; } else if (op == this.OP_TO_INT) { this.symbol_table[this.r.res].TypeId = 8; } else if (op == this.OP_TO_ULONG) { this.symbol_table[this.r.res].TypeId = 14; } else if (op == this.OP_TO_LONG) { this.symbol_table[this.r.res].TypeId = 9; } else if (op == this.OP_TO_CHAR) { this.symbol_table[this.r.res].TypeId = 4; } else if (op == this.OP_TO_FLOAT) { this.symbol_table[this.r.res].TypeId = 7; } else if (op == this.OP_TO_DOUBLE) { this.symbol_table[this.r.res].TypeId = 6; } else if (op == this.OP_TO_DECIMAL) { this.symbol_table[this.r.res].TypeId = 5; } else if (op == this.OP_TO_STRING) { this.symbol_table[this.r.res].TypeId = 12; } else if (op == this.OP_TO_BOOLEAN) { this.symbol_table[this.r.res].TypeId = 2; } else { if (op == this.OP_INC) { this.CheckOP_INC(); if (!this.scripter.IsError()) { goto Label_0079; } goto Label_22C6; } if (op == this.OP_DEC) { this.CheckOP_DEC(); if (!this.scripter.IsError()) { goto Label_0079; } goto Label_22C6; } if (op == this.OP_ASSIGN_COND_TYPE) { this.CheckOP_ASSIGN_COND_TYPE(); } else if (op == this.OP_ADD_EXPLICIT_INTERFACE) { this.OperAddExplicitInterface(); } else if (op == this.OP_END_CLASS) { stack.Pop(); if (stack.Count > 0) { int num39 = stack.Peek(); classObject = this.GetClassObject(num39); } else { classObject = null; } } else { if (op != this.OP_CREATE_CLASS) { if (op == this.OP_CREATE_OBJECT) { ClassObject obj27 = this.GetClassObject(this.r.arg1); if (!obj27.Abstract && !obj27.IsInterface) { goto Label_0079; } this.scripter.CreateErrorObjectEx("CS0144. Cannot create an instance of the abstract class or interface '{0}'.", new object[] { obj27.Name }); } else { if (op == this.OP_END_USING) { if ((obj2 != null) && (obj2.Id == this.r.arg1)) { obj2 = null; } goto Label_0079; } if (op == this.OP_ASSIGN) { this.CheckOP_ASSIGN(obj2); if (!this.scripter.IsError()) { goto Label_0079; } } else { if (op == this.OP_UNARY_MINUS) { if (!this.SetupDetailedUnaryOperator(op, "-", this.detailed_negation_operators)) { goto Label_22C6; } if (this[this.n].op != this.OP_CALL_SIMPLE) { this.r = this[this.n]; int num48 = this.GetTypeId(this.r.arg1); int num49 = this.GetTypeId(this.r.res); if ((num48 != num49) && IsNumericTypeId(num49)) { this.InsertNumericConversion(num49, 1); } } goto Label_0079; } if (op == this.OP_NOT) { if (this.SetupDetailedUnaryOperator(op, "!", this.detailed_logical_negation_operators)) { goto Label_0079; } } else { if (op == this.OP_COMPLEMENT) { if (!this.SetupDetailedUnaryOperator(op, "~", this.detailed_bitwise_complement_operators)) { goto Label_22C6; } if (this[this.n].op != this.OP_CALL_SIMPLE) { this.r = this[this.n]; int num50 = this.GetTypeId(this.r.arg1); int num51 = this.GetTypeId(this.r.res); if ((num50 != num51) && IsNumericTypeId(num51)) { this.InsertNumericConversion(num51, 1); } } goto Label_0079; } if (op == this.OP_PLUS) { this.CheckOP_PLUS(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_MINUS) { this.CheckOP_MINUS(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_MULT) { this.CheckOP_MULT(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_EXPONENT) { this.CheckOP_EXP(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_DIV) { this.CheckOP_DIV(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_MOD) { this.CheckOP_MOD(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_LEFT_SHIFT) { this.CheckOP_LEFT_SHIFT(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_RIGHT_SHIFT) { this.CheckOP_RIGHT_SHIFT(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_BITWISE_AND) { this.CheckOP_BITWISE_AND(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_BITWISE_OR) { this.CheckOP_BITWISE_OR(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_BITWISE_XOR) { this.CheckOP_BITWISE_XOR(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_LOGICAL_AND) { this.CheckOP_LOGICAL_AND(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_LOGICAL_OR) { this.CheckOP_LOGICAL_OR(); if (!this.scripter.IsError()) { goto Label_0079; } } else { if (op == this.OP_LT) { if (!this.SetupDetailedBinaryOperator(op, "<", this.detailed_lt_operators)) { goto Label_22C6; } this.symbol_table[this.r.res].TypeId = 2; goto Label_0079; } if (op == this.OP_LE) { if (!this.SetupDetailedBinaryOperator(op, "<=", this.detailed_le_operators)) { goto Label_22C6; } this.symbol_table[this.r.res].TypeId = 2; goto Label_0079; } if (op == this.OP_GT) { if (!this.SetupDetailedBinaryOperator(op, ">", this.detailed_gt_operators)) { goto Label_22C6; } this.symbol_table[this.r.res].TypeId = 2; goto Label_0079; } if (op == this.OP_GE) { if (!this.SetupDetailedBinaryOperator(op, ">=", this.detailed_ge_operators)) { goto Label_22C6; } this.symbol_table[this.r.res].TypeId = 2; goto Label_0079; } if (op == this.OP_EQ) { this.CheckOP_EQ(); if (!this.scripter.IsError()) { goto Label_0079; } } else if (op == this.OP_NE) { this.CheckOP_NE(); if (!this.scripter.IsError()) { goto Label_0079; } } else { if (op == this.OP_IS) { this.symbol_table[this.r.res].TypeId = 2; goto Label_0079; } if (op == this.OP_AS) { if (this.symbol_table[this.r.arg2].Kind != MemberKind.Type) { this.scripter.CreateErrorObject("CS1031. Type expected."); goto Label_22C6; } ClassObject obj28 = this.GetClassObject(this.symbol_table[this.r.arg1].TypeId); ClassObject obj29 = this.GetClassObject(this.r.arg2); if (obj29.IsValueType) { this.scripter.CreateErrorObjectEx("CS0077. The as operator must be used with a reference type ('{0}' is a value type).", new object[] { obj29.Name }); goto Label_22C6; } if (!this.scripter.conversion.ExistsImplicitReferenceConversion(obj29, obj28)) { this.scripter.CreateErrorObjectEx("CS0039. Cannot convert type '{0}' to '{1}'.", new object[] { obj29.Name, obj28.Name }); goto Label_22C6; } this.symbol_table[this.r.res].TypeId = this.r.arg2; goto Label_0079; } if (op == this.OP_CREATE_REFERENCE) { this.CheckOP_CREATE_REFERENCE(classObject); if (this.scripter.IsError()) { goto Label_22C6; } goto Label_0079; } if (op == this.OP_DECLARE_LOCAL_VARIABLE) { this.OperDeclareLocalVariable(); goto Label_0079; } if (op != this.OP_ADDRESS_OF) { goto Label_0079; } this.ProcessAddressOf(); if (!this.scripter.IsError()) { goto Label_0079; } } } } } } goto Label_22C6; } bool flag3 = this.GetUpcase(this.n); ClassObject obj18 = this.GetClassObject(this.r.arg1); if (obj18.Class_Kind == ClassKind.Enum) { obj2 = obj18; } classObject = obj18; stack.Push(classObject.Id); if (obj18.IsClass || obj18.IsStruct) { int num40 = 0; for (int num41 = 0; num41 < obj18.AncestorIds.Count; num41++) { int num42 = obj18.AncestorIds[num41]; ClassObject obj19 = this.GetClassObject(num42); if (!obj19.IsInterface) { num40++; if (num40 > 1) { this.scripter.CreateErrorObjectEx("CS0527. '{0}' : type in interface list is not an interface.", new object[] { obj19.Name }); break; } } } IntegerList supportedInterfaceListIds = obj18.GetSupportedInterfaceListIds(); if (obj18.AncestorClass.HasModifier(Modifier.Abstract)) { supportedInterfaceListIds.Add(obj18.AncestorClass.Id); } for (int num43 = 0; num43 < supportedInterfaceListIds.Count; num43++) { int num44 = supportedInterfaceListIds[num43]; ClassObject obj20 = this.GetClassObject(num44); for (int num45 = 0; num45 < obj20.Members.Count; num45++) { MemberObject obj21 = obj20.Members[num45]; if (obj21.HasModifier(Modifier.Abstract)) { if (((obj21.Kind == MemberKind.Method) || (obj21.Kind == MemberKind.Constructor)) || (obj21.Kind == MemberKind.Destructor)) { bool flag4 = false; FunctionObject fy = (FunctionObject) obj21; for (int num46 = 0; num46 < obj18.Members.Count; num46++) { MemberObject obj23 = obj18.Members[num46]; if (obj23.Public && (obj21.Kind == obj23.Kind)) { if (CSLite_System.CompareStrings(obj21.Name, obj23.Name, flag3)) { FunctionObject fx = (FunctionObject) obj23; if (FunctionObject.CompareHeaders(fx, fy)) { flag4 = true; break; } } if (obj23.ImplementsId != 0) { string str6 = this.symbol_table[obj23.ImplementsId].Name; if (CSLite_System.CompareStrings(obj21.Name, str6, flag3)) { flag4 = true; break; } } } } if (flag4) { continue; } if (obj20.IsInterface) { this.scripter.CreateErrorObjectEx("CS0535. '{0}' does not implement interface member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + fy.Name }); } else if (obj20.IsClass) { this.scripter.CreateErrorObjectEx("CS0534. '{0}' does not implement inherited abstract member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + fy.Name }); } break; } if (obj21.Kind == MemberKind.Property) { bool flag5 = false; PropertyObject obj25 = (PropertyObject) obj21; for (int num47 = 0; num47 < obj18.Members.Count; num47++) { MemberObject obj26 = obj18.Members[num47]; if (obj26.Public && (obj21.Kind == obj26.Kind)) { if (CSLite_System.CompareStrings(obj21.Name, obj26.Name, flag3)) { flag5 = true; break; } if (obj26.ImplementsId != 0) { string str7 = this.symbol_table[obj26.ImplementsId].Name; if (CSLite_System.CompareStrings(obj21.Name, str7, flag3)) { flag5 = true; break; } } } } if (!flag5) { if (obj20.IsInterface) { this.scripter.CreateErrorObjectEx("CS0535. '{0}' does not implement interface member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + obj25.Name }); } else if (obj20.IsClass) { this.scripter.CreateErrorObjectEx("CS0534. '{0}' does not implement inherited abstract member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + obj25.Name }); } break; } } } } } } } } } goto Label_0079; } this.r.op = this.OP_CALL; int id = this.r.arg1; if (this.symbol_table[id].Kind != MemberKind.Method) { goto Label_0079; } int num22 = this.r.arg2; a.Clear(); list2.Clear(); pos.Clear(); if (num22 > 0) { int num23 = this.n - 1; do { if ((this[num23].op == this.OP_PUSH) && (this[num23].res == id)) { pos.Add(num23); a.Add(this[num23].arg1); list2.Add(this[num23].arg2); if (a.Count == num22) { goto Label_0C8B; } } num23--; } while (num23 != 0); this.scripter.CreateErrorObject("CS0001. Internal compiler error."); return; } Label_0C8B: obj9 = this.GetFunctionObject(id); bool flag2 = true; for (int j = 0; j < num22; j++) { int paramId = obj9.GetParamId(j); int num26 = a[j]; if (!obj9.Imported) { flag2 = ((int)obj9.GetParamMod(j) == list2[j]); } else { flag2 = true; } if (!flag2) { this.n = pos[j]; ParamMod paramMod = obj9.GetParamMod(j); ParamMod mod2 = (ParamMod) list2[j]; int num27 = this.symbol_table[paramId].TypeId; int num28 = this.symbol_table[num26].TypeId; string str4 = this.symbol_table[num27].Name; string str5 = this.symbol_table[num28].Name; switch (paramMod) { case ParamMod.RetVal: str4 = "ref " + str4; break; case ParamMod.Out: str4 = "out " + str4; break; } if (mod2 == ParamMod.RetVal) { str5 = "ref " + str5; } else if (mod2 == ParamMod.Out) { str5 = "out " + str5; } this.scripter.CreateErrorObjectEx("CS0029. Cannot impllicitly convert type '{0}' to '{1}'.", new object[] { str4, str5 }); break; } flag2 = this.scripter.MatchAssignment(paramId, num26); if (!flag2) { this.n = pos[j]; int num29 = this.symbol_table[paramId].TypeId; int num30 = this.symbol_table[num26].TypeId; ClassObject obj10 = this.GetClassObject(num29); ClassObject obj11 = this.GetClassObject(num30); int num31 = obj10.FindOverloadableImplicitOperatorId(num26, paramId); if (num31 > 0) { int currMethodId = this.GetCurrMethodId(); int num33 = this.AppVar(currMethodId, num29); int res = this[this.n].res; this[this.n].arg1 = num33; this.InsertOperators(this.n, 3); this[this.n].op = this.OP_PUSH; this[this.n].arg1 = num26; this[this.n].arg2 = 0; this[this.n].res = num31; this.n++; this[this.n].op = this.OP_PUSH; this[this.n].arg1 = obj10.Id; this[this.n].arg2 = 0; this[this.n].res = 0; this.n++; this[this.n].op = this.OP_CALL_SIMPLE; this[this.n].arg1 = num31; this[this.n].arg2 = 1; this[this.n].res = num33; while (this[this.n].arg1 != res) { this.n++; } goto Label_0079; } this.scripter.CreateErrorObjectEx("CS0029. Cannot impllicitly convert type '{0}' to '{1}'.", new object[] { obj11.Name, obj10.Name }); break; } } if (flag2) { goto Label_0079; } Label_22C6: num52 = 0; while (num52 < list4.Count) { this.n = list4[num52]; this[this.n].op = this.OP_NOP; num52++; } }