This commit is contained in:
parent
db48b41fd0
commit
1368210c79
16
TestSuite/generics60.pas
Normal file
16
TestSuite/generics60.pas
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
type
|
||||
t1<T> = class
|
||||
|
||||
function f<T2>(o: T2) := default(T);
|
||||
|
||||
end;
|
||||
|
||||
function f<T>: T;
|
||||
begin
|
||||
var o: t1<T> := new t1<T>;
|
||||
Result := o.f(0);
|
||||
end;
|
||||
|
||||
begin
|
||||
assert(f&<integer> = 0);
|
||||
end.
|
||||
|
|
@ -1746,7 +1746,7 @@ namespace PascalABCCompiler.TreeRealization
|
|||
cmn.overrided_method = common_orig.overrided_method;
|
||||
if (orig_fn.is_generic_function)
|
||||
{
|
||||
cmn.return_value_type = generic_convertions.determine_type(cmn.return_value_type, meth_inst_pars, true);
|
||||
cmn.return_value_type = generic_convertions.determine_type(cmn.return_value_type, meth_inst_pars, true, orig_tpars);
|
||||
}
|
||||
if (orig_fn is common_function_node)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue