bug fix #471
This commit is contained in:
parent
03656f90f1
commit
aaebcf48c9
|
|
@ -33,6 +33,16 @@ begin
|
|||
raise new Exception;
|
||||
end;
|
||||
|
||||
type
|
||||
TClass=class
|
||||
|
||||
function f(a: integer := 1; b: integer := 2): integer;
|
||||
begin
|
||||
Result:=2;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
assert(test3=4);
|
||||
assert(test(2)=3);
|
||||
|
|
@ -48,4 +58,7 @@ assert(k = 6);
|
|||
tt(ff);
|
||||
assert(ArrRandomReal <> nil);
|
||||
assert(ArrRandomReal.Any = true);
|
||||
var obj := new TClass;
|
||||
var l := obj.f;
|
||||
assert(l = 2);
|
||||
end.
|
||||
|
|
@ -4113,6 +4113,12 @@ namespace PascalABCCompiler.TreeRealization
|
|||
if (cnfn.num_of_default_parameters == cnfn.parameters.Count)
|
||||
return bfc;
|
||||
}
|
||||
else if (bfc.function is common_method_node)
|
||||
{
|
||||
common_method_node cmn = bfc.function as common_method_node;
|
||||
if (cmn.num_of_default_parameters == cmn.parameters.Count)
|
||||
return bfc;
|
||||
}
|
||||
else if (bfc.function is compiled_function_node)
|
||||
{
|
||||
compiled_function_node cfn = bfc.function as compiled_function_node;
|
||||
|
|
|
|||
Loading…
Reference in a new issue