formatting of explicit implemented properties
new tests for explicit implemented properties
This commit is contained in:
parent
938f9328b1
commit
08b67078ec
|
|
@ -3471,6 +3471,7 @@ namespace CodeFormatters
|
|||
{
|
||||
foreach (ident id in _property_ident.ln)
|
||||
visit_node(id);
|
||||
return;
|
||||
}
|
||||
WriteAmpersandIfNeed(_property_ident);
|
||||
sb.Append(prepare_ident(_property_ident.name));
|
||||
|
|
|
|||
20
TestSuite/explicitinterface11.pas
Normal file
20
TestSuite/explicitinterface11.pas
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
type
|
||||
I1 = interface
|
||||
property X: integer read write;
|
||||
end;
|
||||
|
||||
T1 = record(I1)
|
||||
x1: integer;
|
||||
x2: integer;
|
||||
property X: integer read x1 write x1;
|
||||
property I1.X: integer read x2 write x2;
|
||||
end;
|
||||
|
||||
begin
|
||||
var r: T1;
|
||||
r.X := 1;
|
||||
assert(r.X = 1);
|
||||
var r1: I1 := r;
|
||||
r1.X := 3;
|
||||
assert(r1.X = 3);
|
||||
end.
|
||||
17
TestSuite/formatter_tests/input/property7.pas
Normal file
17
TestSuite/formatter_tests/input/property7.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
type
|
||||
I1 = interface
|
||||
property X: integer read;
|
||||
end;
|
||||
|
||||
T1 = record(I1)
|
||||
property X: integer read 1;
|
||||
property I1<T1, T2>.X: integer read 2;
|
||||
end;
|
||||
|
||||
begin
|
||||
var r: T1;
|
||||
assert(r.X = 1);
|
||||
var r1: I1 := r;
|
||||
writeln(r1.X);
|
||||
assert(r1.X = 2);
|
||||
end.
|
||||
17
TestSuite/formatter_tests/should/property7.pas
Normal file
17
TestSuite/formatter_tests/should/property7.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
type
|
||||
I1 = interface
|
||||
property X: integer read;
|
||||
end;
|
||||
|
||||
T1 = record(I1)
|
||||
property X: integer read 1;
|
||||
property I1<T1, T2>.X: integer read 2;
|
||||
end;
|
||||
|
||||
begin
|
||||
var r: T1;
|
||||
assert(r.X = 1);
|
||||
var r1: I1 := r;
|
||||
writeln(r1.X);
|
||||
assert(r1.X = 2);
|
||||
end.
|
||||
Loading…
Reference in a new issue