This commit is contained in:
Ivan Bondarev 2022-05-08 11:41:12 +02:00
parent 02f177d5ba
commit 0664033ee2
3 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,20 @@
unit u_records6;
type
intr = interface
procedure p;
end;
r = record(intr)
// Обязательно использовать тот же конструктор, что и в p1
procedure p := new r;
end;
// Обязательно принимать интерфейс
procedure p0(o: intr) := exit;
// Обязательно передать экземпляр r, не присвоенный ни одной переменной
// (можно использовать как простой обход)
procedure p1 := p0(new r);
end.

View file

@ -0,0 +1,4 @@
uses u_records7;
begin
p1;
end.

View file

@ -472,7 +472,7 @@ namespace PascalABCCompiler.TreeRealization
[Serializable]
public class common_static_method_call : base_function_call_with_method<common_method_node>, SemanticTree.ICommonStaticMethodCallNode
{
private common_type_node _common_type;
private common_type_node _common_type;//zachem dublirovat svojstvo iz common_method_node????
public common_static_method_call(common_method_node static_method,location loc) :
base(static_method,loc)
@ -486,7 +486,9 @@ namespace PascalABCCompiler.TreeRealization
{
get
{
return _common_type;
if (_common_type != null)
return _common_type;
return function_node.cont_type;
}
}
@ -508,7 +510,9 @@ namespace PascalABCCompiler.TreeRealization
{
get
{
return _common_type;
if (_common_type != null)
return _common_type;
return function_node.cont_type;
}
}