This commit is contained in:
Бондарев Иван 2016-08-12 17:24:09 +02:00
parent 466d274250
commit 272ea816e2
3 changed files with 36 additions and 14 deletions

View file

@ -1,4 +1,4 @@
// Игра в 15
// Игра в 15
uses GraphABC,ABCObjects,ABCButtons;
const

View 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.

View file

@ -3748,21 +3748,30 @@ namespace PascalABCCompiler.TreeConverter
}
if (SemanticRules.OrderIndependedMethodNames)
{
visit_class_member_realizations(_class_body);
}
if (!context.converted_type.is_value && !context.converted_type.IsInterface)
{
generate_inherit_constructors();
}
if (!context.converted_type.IsInterface && context.converted_type.static_constr == null)
{
//generate_static_constructor();
}
if (!context.converted_type.IsInterface && !context.converted_type.has_default_constructor)
{
generate_default_constructor();
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();
}
visit_class_member_realizations(_class_body);
}
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;