bug fix
This commit is contained in:
parent
8a80aada64
commit
697fb91312
|
|
@ -790,24 +790,26 @@ namespace PascalABCCompiler.PCU
|
|||
param_types[i] = FindSpecTypeByHandle(pcu_file.dotnet_names[off].addit[i].offset);
|
||||
}
|
||||
MethodInfo mi = null;
|
||||
if (pcu_file.dotnet_names[off].name != "op_Explicit")
|
||||
if (pcu_file.dotnet_names[off].name != "op_Explicit")
|
||||
{
|
||||
//mi = t.GetMethod(pcu_file.dotnet_names[off].name, param_types);
|
||||
List<MemberInfo> mis = NetHelper.NetHelper.GetMembers(t, pcu_file.dotnet_names[off].name);
|
||||
mi = ChooseMethod(t, mis, param_types);
|
||||
}
|
||||
else
|
||||
{
|
||||
MethodInfo[] mis = t.GetMethods();
|
||||
foreach (MethodInfo mi2 in mis)
|
||||
if (mi2.Name == "op_Explicit" && mi2.GetParameters()[0].ParameterType == param_types[0].t && mi2.ReturnType == param_types[1].t) mi = mi2;
|
||||
if (mi == null)
|
||||
{
|
||||
//mi = t.GetMethod(pcu_file.dotnet_names[off].name, param_types);
|
||||
List<MemberInfo> mis = NetHelper.NetHelper.GetMembers(t, pcu_file.dotnet_names[off].name);
|
||||
mi = ChooseMethod(t, mis, param_types);
|
||||
}
|
||||
else
|
||||
{
|
||||
MethodInfo[] mis = t.GetMethods();
|
||||
foreach (MethodInfo mi2 in mis)
|
||||
if (mi2.Name == "op_Explicit" && mi2.GetParameters()[0].ParameterType == param_types[0].t && mi2.ReturnType == param_types[1].t) mi = mi2;
|
||||
if (mi == null)
|
||||
{
|
||||
List<MemberInfo> mis2 = NetHelper.NetHelper.GetMembers(t, pcu_file.dotnet_names[off].name);
|
||||
mi = ChooseMethod(t, mis2, param_types);
|
||||
//mi = t.GetMethod(pcu_file.dotnet_names[off].name, new Type[1] { param_types[0].t });
|
||||
}
|
||||
List<MemberInfo> mis2 = NetHelper.NetHelper.GetMembers(t, pcu_file.dotnet_names[off].name);
|
||||
mi = ChooseMethod(t, mis2, param_types);
|
||||
//mi = t.GetMethod(pcu_file.dotnet_names[off].name, new Type[1] { param_types[0].t });
|
||||
}
|
||||
}
|
||||
if (mi == null)
|
||||
throw new Exception(pcu_file.dotnet_names[off].name+" "+t.FullName);
|
||||
dot_net_cache[off] = mi;
|
||||
return mi;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,21 @@ begin
|
|||
Result := a;
|
||||
end;
|
||||
|
||||
function ff(delim: string := ' '): string;
|
||||
begin
|
||||
Result := 'abc';
|
||||
end;
|
||||
|
||||
procedure tt(str: string);
|
||||
begin
|
||||
assert(str = 'abc');
|
||||
end;
|
||||
|
||||
procedure tt(i: integer);
|
||||
begin
|
||||
raise new Exception;
|
||||
end;
|
||||
|
||||
begin
|
||||
assert(test(2)=3);
|
||||
assert(test(2,4)=4);
|
||||
|
|
@ -24,4 +39,5 @@ var s := 'abcd';
|
|||
assert(s.test=6);
|
||||
var k := s.test;
|
||||
assert(k = 6);
|
||||
tt(ff);
|
||||
end.
|
||||
|
|
@ -2267,9 +2267,9 @@ end;
|
|||
function FormatStr(obj: object): string;
|
||||
begin
|
||||
if (obj.GetType = typeof(char)) or (obj.GetType = typeof(string)) then
|
||||
Result := '''' + string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, '{0}', obj) + ''''
|
||||
Result := '''' + string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, '{0}', new object[](obj)) + ''''
|
||||
else
|
||||
Result := string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, '{0}', obj)
|
||||
Result := string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, '{0}', new object[](obj))
|
||||
end;
|
||||
|
||||
function TypedSet.ToString: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue