This commit is contained in:
parent
466d274250
commit
272ea816e2
|
|
@ -1,4 +1,4 @@
|
||||||
// Игра в 15
|
// Игра в 15
|
||||||
uses GraphABC,ABCObjects,ABCButtons;
|
uses GraphABC,ABCObjects,ABCButtons;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
||||||
13
TestSuite/defaultconstr1.pas
Normal file
13
TestSuite/defaultconstr1.pas
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
type A = class
|
||||||
|
i: integer;
|
||||||
|
procedure p;
|
||||||
|
begin
|
||||||
|
var w := new A;
|
||||||
|
w.i := 2;
|
||||||
|
assert(w.i = 2);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
var obj := new A;
|
||||||
|
obj.p;
|
||||||
|
end.
|
||||||
|
|
@ -3748,21 +3748,30 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
}
|
}
|
||||||
if (SemanticRules.OrderIndependedMethodNames)
|
if (SemanticRules.OrderIndependedMethodNames)
|
||||||
{
|
{
|
||||||
visit_class_member_realizations(_class_body);
|
if (!context.converted_type.is_value && !context.converted_type.IsInterface)
|
||||||
}
|
{
|
||||||
if (!context.converted_type.is_value && !context.converted_type.IsInterface)
|
generate_inherit_constructors();
|
||||||
{
|
}
|
||||||
generate_inherit_constructors();
|
if (!context.converted_type.IsInterface && !context.converted_type.has_default_constructor)
|
||||||
}
|
{
|
||||||
if (!context.converted_type.IsInterface && context.converted_type.static_constr == null)
|
generate_default_constructor();
|
||||||
{
|
}
|
||||||
//generate_static_constructor();
|
|
||||||
}
|
visit_class_member_realizations(_class_body);
|
||||||
if (!context.converted_type.IsInterface && !context.converted_type.has_default_constructor)
|
|
||||||
{
|
|
||||||
generate_default_constructor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SemanticRules.OrderIndependedMethodNames)
|
||||||
|
{
|
||||||
|
if (!context.converted_type.is_value && !context.converted_type.IsInterface)
|
||||||
|
{
|
||||||
|
generate_inherit_constructors();
|
||||||
|
}
|
||||||
|
if (!context.converted_type.IsInterface && !context.converted_type.has_default_constructor)
|
||||||
|
{
|
||||||
|
generate_default_constructor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool disable_order_independ;
|
private bool disable_order_independ;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue