This commit is contained in:
Ivan Bondarev 2022-01-23 14:29:02 +01:00
parent cb2e072d69
commit 3b8fa5ff34
2 changed files with 27 additions and 0 deletions

19
TestSuite/interface5.pas Normal file
View file

@ -0,0 +1,19 @@
type
I1 = interface
property p1: byte read write;
end;
//Ошибка: Класс t1 не реализует метод get_p1:byte интерфейса I1
t1 = class(I1)
public b: byte;
b2: byte;
public property I1.p1: byte read b write b;
public property p1: byte read b2;
end;
begin
var o: I1 := new t1;
o.p1 := 1;
assert(o.p1 = 1);
var o2 := o as t1;
assert(o2.p1 = 0);
end.

View file

@ -389,10 +389,18 @@ namespace PascalABCCompiler.TreeConverter
}
public static string GetGetAccessorName(string name)
{
if (name.IndexOf(".") != -1)
{
return string.Format("{0}get_{1}", name.Substring(0, name.LastIndexOf('.') + 1), name.Substring(name.LastIndexOf('.')+1));
}
return GetAccessorName("get_{0}", name);
}
public static string GetSetAccessorName(string name)
{
if (name.IndexOf(".") != -1)
{
return string.Format("{0}set_{1}", name.Substring(0, name.LastIndexOf('.') + 1), name.Substring(name.LastIndexOf('.') + 1));
}
return GetAccessorName("set_{0}", name);
}
public static string GetAddHandler(string name)