bug fix #867
This commit is contained in:
Бондарев Иван 2018-06-03 14:48:27 +02:00
parent a2c16c54cb
commit df8a5445ec
7 changed files with 2874 additions and 2793 deletions

View file

@ -1,9 +1,9 @@
//
// This CSharp output file generated by Gardens Point LEX
// Version: 1.1.3.301
// Machine: DESKTOP-A6LT9RI
// DateTime: 31.05.2018 0:33:45
// UserName: ?????????
// Machine: IVAN-PC
// DateTime: 03.06.2018 14:22:56
// UserName: Ivan
// GPLEX input file <ABCPascal.lex>
// GPLEX frame file <embedded resource>
//

View file

@ -861,6 +861,10 @@ sign
const_variable
: identifier
{ $$ = $1; }
| tkInherited identifier
{
$$ = new inherited_ident($2.name, @$);
}
| sizeof_expr
{ $$ = $1; }
| typeof_expr

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,22 @@
type
t1 = class
function GetP1:byte := 0;
property P1:byte read GetP1; virtual;
end;
t2 = class(t1)
function NewGetP1:byte;
begin
var b := inherited self.P1;//тут вызывается NewGetP1 вместо GetP1
end;
property P1:byte read NewGetP1; override;
end;
begin
var b := (new t2).p1;
end.

16
TestSuite/inherited2.pas Normal file
View file

@ -0,0 +1,16 @@
type
t1 = class
function p1:byte; virtual := 1;
end;
t2 = class(t1)
function p1:byte; override;
begin
var b:byte := inherited p1;
Result := b;
end;
end;
begin
var o := new t2;
assert(o.p1 = 1);
end.

24
TestSuite/inherited3.pas Normal file
View file

@ -0,0 +1,24 @@
type
t1 = class
function GetP1:byte := 1;
property P1:byte read GetP1; virtual;
end;
t2 = class(t1)
function NewGetP1:byte;
begin
var b := inherited P1;
Result := b;
end;
property P1:byte read NewGetP1; override;
end;
begin
var b := (new t2).p1;
assert(b = 1);
end.

View file

@ -8890,7 +8890,11 @@ namespace PascalABCCompiler.TreeConverter
case general_node_type.property_node:
case general_node_type.variable_node:
{
expression_node ex_nd = ident_value_reciving(si_left, id_left);
expression_node ex_nd = null;
if (id_left is inherited_ident)
ex_nd = inherited_ident_value_reciving(id_left as inherited_ident);
else
ex_nd = ident_value_reciving(si_left, id_left);
dot_node_as_expression_dot_ident(ex_nd, id_right, mot, id_left);
return;
}
@ -9506,7 +9510,10 @@ namespace PascalABCCompiler.TreeConverter
dot_node_as_ident_dot_template_ident(id_left, _dot_node.right as ident_with_templateparams, mot);
return;
}
if (id_left is inherited_ident)
inherited_ident_processing = true;
dot_node_as_ident_dot_ident(id_left, id_right, mot);
inherited_ident_processing = false;
return;
}
else