parent
a2c16c54cb
commit
df8a5445ec
|
|
@ -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>
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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
22
TestSuite/errors/err0241.pas
Normal file
22
TestSuite/errors/err0241.pas
Normal 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
16
TestSuite/inherited2.pas
Normal 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
24
TestSuite/inherited3.pas
Normal 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.
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue