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; uses GraphABC,ABCObjects,ABCButtons;
const 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) 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;