bug fix #2507
This commit is contained in:
parent
fe9d908f74
commit
374f329115
|
|
@ -7343,7 +7343,7 @@ namespace PascalABCCompiler.NETGenerator
|
|||
bool tmp_dot = is_dot_expr;
|
||||
if (!tmp_dot)
|
||||
is_dot_expr = true;
|
||||
if ((value.method.polymorphic_state == polymorphic_state.ps_virtual || value.method.polymorphic_state == polymorphic_state.ps_virtual_abstract) && (value.obj is ICommonParameterReferenceNode || value.obj is ICommonClassFieldReferenceNode))
|
||||
if ((value.method.polymorphic_state == polymorphic_state.ps_virtual || value.method.polymorphic_state == polymorphic_state.ps_virtual_abstract || value.method.polymorphic_state == polymorphic_state.ps_common) && (value.obj is ICommonParameterReferenceNode || value.obj is ICommonClassFieldReferenceNode))
|
||||
virtual_method_call = true;
|
||||
value.obj.visit(this);
|
||||
virtual_method_call = false;
|
||||
|
|
|
|||
20
TestSuite/generics56.pas
Normal file
20
TestSuite/generics56.pas
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
var i: integer;
|
||||
type
|
||||
t1 = class
|
||||
// Обязательно НЕ виртуальный метод
|
||||
procedure p1(x: integer);
|
||||
begin
|
||||
i := x;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure p0<T>(a: T);
|
||||
where T: t1;
|
||||
begin
|
||||
a.p1(1);
|
||||
end;
|
||||
|
||||
begin
|
||||
p0(new t1);
|
||||
assert(i = 1);
|
||||
end.
|
||||
23
TestSuite/generics57.pas
Normal file
23
TestSuite/generics57.pas
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
var i: integer;
|
||||
type
|
||||
IInt = interface
|
||||
procedure p1(x: integer);
|
||||
end;
|
||||
|
||||
t1 = class(IInt)
|
||||
public procedure p1(x: integer);
|
||||
begin
|
||||
i := x;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure p0<T>(a: T);
|
||||
where T: IInt;
|
||||
begin
|
||||
a.p1(1);
|
||||
end;
|
||||
|
||||
begin
|
||||
p0(new t1);
|
||||
assert(i = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue